平台 模板列表 状态
This commit is contained in:
parent
a26357e47e
commit
2f727b65e6
|
|
@ -49,8 +49,9 @@ public class SmsShopTemplateController {
|
|||
* 列表
|
||||
*/
|
||||
@GetMapping("/smsTemplate")
|
||||
public CzgResult<List<SmsShopTemplateDTO>> getTemplateList(@RequestParam(required = false) String title) {
|
||||
List<SmsShopTemplateDTO> data = templateService.getTemplateList(title, StpKit.USER.getShopId());
|
||||
public CzgResult<List<SmsShopTemplateDTO>> getTemplateList(@RequestParam(required = false) String title,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
List<SmsShopTemplateDTO> data = templateService.getTemplateList(title, StpKit.USER.getShopId(),status);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public interface SmsShopTemplateService extends IService<SmsShopTemplate> {
|
|||
* @param name 模板名称 模糊
|
||||
* @return 店铺短信模板列表
|
||||
*/
|
||||
List<SmsShopTemplateDTO> getTemplateList(String name, Long shopId);
|
||||
List<SmsShopTemplateDTO> getTemplateList(String name, Long shopId, Integer status);
|
||||
|
||||
void addTemplate(SmsShopTemplateDTO param);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,18 @@ public class SmsShopTemplateServiceImpl extends ServiceImpl<SmsShopTemplateMappe
|
|||
private RabbitPublisher rabbitPublisher;
|
||||
|
||||
@Override
|
||||
public List<SmsShopTemplateDTO> getTemplateList(String name, Long shopId) {
|
||||
public List<SmsShopTemplateDTO> getTemplateList(String name, Long shopId, Integer status) {
|
||||
List<Long> list = Arrays.asList(1L, shopId);
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.like(SmsShopTemplate::getTitle, name)
|
||||
.in(SmsShopTemplate::getShopId, list)
|
||||
.orderBy(SmsShopTemplate::getShopId).asc()
|
||||
.orderBy(SmsShopTemplate::getSort).asc();
|
||||
if (shopId != 1L) {
|
||||
queryWrapper.eq(SmsShopTemplate::getStatus, status);
|
||||
} else {
|
||||
queryWrapper.eq(SmsShopTemplate::getStatus, 1);
|
||||
}
|
||||
return listAs(queryWrapper, SmsShopTemplateDTO.class);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue