package com.jeesharp.business.member.controller;

import com.jeesharp.framework.memberauth.web.BaseMobileController;
import com.jeesharp.framework.pojo.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.*;

/**
 * 移动端成长值接口
 *
 * @author jeesharp
 */
@Slf4j
@RestController
@RequestMapping("${jeesharp.web.mobilePath}/member/growth")
@Tag(name = "移动端-成长值", description = "成长值流水查询接口")
@AllArgsConstructor
public class GrowthMobileController extends BaseMobileController {

    @Operation(summary = "获取成长值流水")
    @PostMapping("/list")
    public AjaxResult<Map<String, Object>> list(@RequestBody Map<String, Object> params) {
        // TODO: 实现获取成长值流水逻辑
        Integer pageNo = (Integer) params.getOrDefault("pageNo", 1);
        Integer pageSize = (Integer) params.getOrDefault("pageSize", 10);
        
        Map<String, Object> data = new HashMap<>();
        data.put("pageNo", pageNo);
        data.put("pageSize", pageSize);
        data.put("totalCount", 30);
        
        List<Map<String, Object>> list = new ArrayList<>();
        Map<String, Object> item = new HashMap<>();
        item.put("id", "xxx");
        item.put("growthType", 1);
        item.put("growthTypeName", "获取");
        item.put("growthValue", 100);
        item.put("bizType", "CONSUME");
        item.put("bizTypeName", "消费");
        item.put("bizDesc", "订单消费获得成长值");
        item.put("isUpgrade", false);
        item.put("createDate", "2026-01-24 10:30:00");
        list.add(item);
        data.put("list", list);
        
        return AjaxResult.okData(data);
    }
}
