| | |
| | | package com.yeshi.makemoney.app.controller.admin.money; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyType; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyRecord; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyRecordService; |
| | | import com.yeshi.makemoney.app.service.query.money.UserMoneyRecordQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/money/record") |
| | | public class UserMoneyRecordAdminController { |
| | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids, String callback) { |
| | | Type type = new TypeToken<List<Long>>(){}.getType(); |
| | | Type type = new TypeToken<List<Long>>() { |
| | | }.getType(); |
| | | List<Long> idList=new Gson().fromJson(ids,type); |
| | | userMoneyRecordService.delete(idList); |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult("")); |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getMoneyTypes") |
| | | public String getMoneyTypes() { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | for (UserMoneyType type : UserMoneyType.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", type.name()); |
| | | data.put("value", type.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |