@@ -10,6 +10,8 @@ import lombok.Setter; | |||
@Setter | |||
public class MsgwUpwardShortPageRequest extends JpaDateTimePageableDataRequest<MsgwUpwardShort>{ | |||
private String mobile; | |||
public MsgwUpwardShortPageRequest() { | |||
this.orderBy="submitTime"; | |||
this.desc=true; | |||
@@ -18,6 +20,7 @@ public class MsgwUpwardShortPageRequest extends JpaDateTimePageableDataRequest<M | |||
@Override | |||
public HqlBuilder toSelectHql(){ | |||
HqlBuilder hql = new HqlBuilder("from MsgwUpwardShort where 1=1 "); | |||
hql.append(" and mobile=:mobile", mobile); | |||
hql.append(" and submitTime>=:startTime", startTime); | |||
hql.append(" and submitTime<=:endTime", endTime); | |||
return hql; |
@@ -0,0 +1,36 @@ | |||
package cn.com.taiji.msgw.api; | |||
import javax.validation.Valid; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwUpwardShortPageRequest; | |||
import cn.com.taiji.msgw.dto.UpwardShortRequestDto; | |||
import cn.com.taiji.msgw.manager.upwardShort.UpwardShortManager; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwSmsKeyConfigPageRequest; | |||
import cn.com.taiji.msgw.manager.smsKey.SmsKeyConfigManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@Api(tags = {"013.上行短信管理"}) | |||
@RestController | |||
@RequestMapping("/upwardShort") | |||
public class UpwardShortController { | |||
@Autowired | |||
private UpwardShortManager upwardShortManager; | |||
@ApiOperation(value = "上行短信-分页查询") | |||
@PostMapping(value = "/page") | |||
public ApiResponse<Pagination> page(@RequestBody @Valid UpwardShortRequestDto request) { | |||
Pagination pagination = upwardShortManager.page(request); | |||
return ApiResponse.of(pagination); | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
package cn.com.taiji.msgw.dto; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/*** | |||
* 短信上行-查询 | |||
*/ | |||
@Getter | |||
@Setter | |||
public class UpwardShortRequestDto extends AbstractStaffBizRequestDTO { | |||
private String mobile; | |||
private int pageNo; | |||
private int pageSize; | |||
private LocalDateTime startTime; | |||
private LocalDateTime endTime; | |||
} |
@@ -0,0 +1,18 @@ | |||
package cn.com.taiji.msgw.manager.upwardShort; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwSmsKeyConfigPageRequest; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwUpwardShortPageRequest; | |||
import cn.com.taiji.msgw.dto.UpwardShortRequestDto; | |||
/** | |||
* @Author weicailin | |||
* @Date 2023/4/27 17:54 | |||
* @Email 13079168756@163.com | |||
*/ | |||
public interface UpwardShortManager { | |||
Pagination page(UpwardShortRequestDto request); | |||
} |
@@ -0,0 +1,39 @@ | |||
package cn.com.taiji.msgw.manager.upwardShort; | |||
import java.util.List; | |||
import cn.com.taiji.core.repo.jpa.msgw.MsgwUpwardShortRepo; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwUpwardShortPageRequest; | |||
import cn.com.taiji.msgw.dto.*; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.CommonAbstract; | |||
import cn.com.taiji.core.entity.msgw.MsgwSmsKeyConfig; | |||
import cn.com.taiji.core.repo.jpa.msgw.MsgwSmsKeyConfigRepo; | |||
import cn.com.taiji.core.repo.request.msgw.MsgwSmsKeyConfigPageRequest; | |||
/** | |||
* @Author weicailin | |||
* @Date 2023/4/27 17:54 | |||
* @Email 13079168756@163.com | |||
*/ | |||
@Service | |||
public class UpwardShortManagerImpl extends CommonAbstract implements UpwardShortManager { | |||
@Autowired | |||
private MsgwUpwardShortRepo upwardShortRepo; | |||
@Override | |||
public Pagination page(UpwardShortRequestDto request) { | |||
MsgwUpwardShortPageRequest pageRequest = new MsgwUpwardShortPageRequest(); | |||
BeanUtils.copyProperties(request, pageRequest); | |||
//获取分页 | |||
Pagination pagination = upwardShortRepo.page(pageRequest); | |||
return pagination; | |||
} | |||
} |