短信 余额 短信 余额 明细
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.market.dto.SmsShopMoneyDetailDTO;
|
||||
import com.czg.market.dto.SmsShopTemplateDTO;
|
||||
import com.czg.market.entity.SmsShopMoney;
|
||||
@@ -38,35 +40,35 @@ public class SmsShopTemplateController {
|
||||
@Resource
|
||||
private SmsShopMoneyMapper shopMoneyMapper;
|
||||
|
||||
// /**
|
||||
// * 列表
|
||||
// */
|
||||
// @GetMapping("/smsTemplate")
|
||||
// public CzgResult<List<SmsShopTemplateDTO>> getTemplateList(@RequestParam(required = false) String title) {
|
||||
// List<SmsShopTemplateDTO> data = templateService.getTemplateList(title, StpKit.USER.getShopId());
|
||||
// return CzgResult.success(data);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增
|
||||
// */
|
||||
// @PostMapping("/smsTemplate")
|
||||
// public CzgResult<Void> addTemplate(@RequestBody @Validated(InsertGroup.class) SmsShopTemplateDTO param) {
|
||||
// param.setShopId(StpKit.USER.getShopId());
|
||||
// templateService.addTemplate(param);
|
||||
// return CzgResult.success();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 重新提交
|
||||
// * 状态为 -1 失败的 可以修改模板重新提交
|
||||
// */
|
||||
// @PostMapping("/smsTemplate/resubmit")
|
||||
// public CzgResult<Void> resubmit(@RequestBody @Validated(UpdateGroup.class) SmsShopTemplateDTO param) {
|
||||
// param.setShopId(StpKit.USER.getShopId());
|
||||
// templateService.resubmit(param);
|
||||
// return CzgResult.success();
|
||||
// }
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("/smsTemplate")
|
||||
public CzgResult<List<SmsShopTemplateDTO>> getTemplateList(@RequestParam(required = false) String title) {
|
||||
List<SmsShopTemplateDTO> data = templateService.getTemplateList(title, StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/smsTemplate")
|
||||
public CzgResult<Void> addTemplate(@RequestBody @Validated(InsertGroup.class) SmsShopTemplateDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
templateService.addTemplate(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新提交
|
||||
* 状态为 -1 失败的 可以修改模板重新提交
|
||||
*/
|
||||
@PostMapping("/smsTemplate/resubmit")
|
||||
public CzgResult<Void> resubmit(@RequestBody @Validated(UpdateGroup.class) SmsShopTemplateDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
templateService.resubmit(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺短信余额
|
||||
@@ -90,9 +92,12 @@ public class SmsShopTemplateController {
|
||||
* 获取店铺短信余额明细
|
||||
*/
|
||||
@GetMapping("/smsMoneyDetail")
|
||||
public CzgResult<Page<SmsShopMoneyDetailDTO>> getSmsMoneyDetailPage(@RequestParam(required = false) Integer page,
|
||||
public CzgResult<JSONObject> getSmsMoneyDetailPage(@RequestParam(required = false) Integer page,
|
||||
@RequestParam(required = false) Integer size) {
|
||||
Page<SmsShopMoneyDetailDTO> data = smsMoneyDetailService.getSmsMoneyDetailPage(StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
JSONObject from = JSONObject.from(data);
|
||||
from.put("sendTotal", smsMoneyDetailService.countSendTotal(StpKit.USER.getShopId()));
|
||||
from.put("sendAmountTotal", smsMoneyDetailService.countSendAmountTotal(StpKit.USER.getShopId()));
|
||||
return CzgResult.success(from);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user