admin
2022-04-07 e1cc0d03fadc2d251d36c0dc3650f75e830d5363
app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornConsumeRecordAdminController.java
@@ -1,6 +1,7 @@
package com.yeshi.makemoney.app.controller.admin.goldcorn;
import com.google.gson.*;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeType;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
@@ -15,9 +16,11 @@
import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord;
import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornConsumeRecordService;
import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornConsumeRecordQuery;
@Controller
@RequestMapping("admin/api/goldcorn/consume/record")
public class GoldCornConsumeRecordAdminController {
@@ -49,7 +52,8 @@
    @ResponseBody
    @RequestMapping("delete")
    public String delete(String ids) {
        Type type = new TypeToken<List<String>>(){}.getType();
        Type type = new TypeToken<List<String>>() {
        }.getType();
        List<String> idList=new Gson().fromJson(ids,type);
        goldCornConsumeRecordService.delete(idList);
        return JsonUtil.loadTrueResult("");
@@ -70,7 +74,18 @@
        }
    }
    @ResponseBody
    @RequestMapping("getTypeList")
    public String getTypeList(String id, HttpSession session) {
        JSONArray array = new JSONArray();
        for (GoldCornConsumeType type : GoldCornConsumeType.values()) {
            JSONObject data = new JSONObject();
            data.put("key", type.name());
            data.put("value", type.getName());
            array.add(data);
        }
        return JsonUtil.loadTrueResult(array);
    }
}