修改PC短信端列表

This commit is contained in:
yuyang 2021-08-04 13:35:36 +08:00
parent af0b78f4a6
commit 9d0fd4c142
5 changed files with 23 additions and 28 deletions

View File

@ -2,6 +2,7 @@ package com.xhpc.general.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.general.service.IXhpcSmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -9,6 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @author yuyang
* @date 2021/8/1 23:42
@ -29,10 +33,11 @@ public class XhpcSmsController extends BaseController {
return xhpcSmsService.getLogonPhoneCode(phone);
}
@GetMapping(value = "/list")
public AjaxResult list(Integer status,String phone){
return xhpcSmsService.getList(status, phone);
@GetMapping(value = "/getList")
public TableDataInfo getList(Integer status, String phone){
startPage();
List<Map<String, Object>> list = xhpcSmsService.getList();
return getDataTable(list);
}
}

View File

@ -14,5 +14,6 @@ public interface XhpcSmsMapper {
int addXhpcSms(XhpcSms xhpcSms);
List<Map<String,Object>> getList(@Param("status") int status,@Param("phone")String phone);
List<Map<String,Object>> getList();
}

View File

@ -2,6 +2,9 @@ package com.xhpc.general.service;
import com.xhpc.common.core.web.domain.AjaxResult;
import java.util.List;
import java.util.Map;
/**
* @author yuyang
* @date 2021/7/30 18:45
@ -16,5 +19,5 @@ public interface IXhpcSmsService {
*/
AjaxResult getLogonPhoneCode(String phone);
AjaxResult getList(Integer status,String phone);
List<Map<String, Object>> getList();
}

View File

@ -93,6 +93,12 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService{
}
@Override
public List<Map<String, Object>> getList() {
return xhpcSmsMapper.getList();
}
private static HashMap<String, String> assembleSmsReq(String phone,String content) {
HashMap<String, String> params = new HashMap<>();
params.put("account", ACCOUNT);
@ -127,14 +133,5 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService{
}
@Override
public AjaxResult getList(Integer status, String phone) {
// List<Map<String,Object>> map=xhpcSmsMapper.getList(status,phone);
// System.out.println();
// System.out.println();
// System.out.println(map.toString());
// System.out.println();
// System.out.println();
return AjaxResult.success(xhpcSmsMapper.getList(status,phone));
}
}

View File

@ -8,7 +8,6 @@
<result property="smsId" column="sms_id"/>
<result property="phone" column="phone"/>
<result property="code" column="code"/>
<result property="templateId" column="template_id"/>
<result property="accessKey" column="access_key"/>
<result property="secretKey" column="secret_key"/>
@ -94,20 +93,10 @@
</trim>
</insert>
<select id="getList" resultType="map">
select
phone,
content,
status,
create_time
*
from xhpc_sms
where del_flag=0
<if test="null!=status">
and status=#{status}
</if>
<if test="null!=phone and ''!=phone">
and phone like concat('%',#{phone},'%')
</if>
</select>
</mapper>