app接口更新

This commit is contained in:
ly19960718 2021-05-08 16:51:18 +08:00
parent e1a16ef108
commit c440eff0b7
3 changed files with 77 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import cn.com.tenlion.pojo.dtos.apply.ApplyDTO;
import cn.com.tenlion.pojo.vos.apply.ApplyVO;
import cn.com.tenlion.service.apply.IApplyService;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -149,6 +150,9 @@ public class ApplyController extends DefaultBaseController {
@GetMapping("listpage")
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
if(!StringUtils.isBlank(params.get("applyAuditStates").toString())){
params.put("applyAuditStates",Arrays.asList(params.get("applyAuditStates")));
}
page.setParams(params);
return applyService.listPage(page);
}

View File

@ -0,0 +1,61 @@
package cn.com.tenlion.controller.app.api.traininginstitution;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResultList;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 培训机构
*/
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "培训机构接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/traininginstitution")
public class TrainingInstitutionController extends DefaultBaseController {
@Autowired
private IInstitutionService iInstitutionService;
@ApiOperation(value = "培训机构分页列表", notes = "培训机构分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage"+ISystemConstant.APP_RELEASE_SUFFIX)
public SuccessResultList<List<InstitutionDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
params.put("institutionType","training");
page.setParams(params);
return iInstitutionService.listPage(page);
}
@ApiOperation(value = "培训机构详情(通过ID)", notes = "培训机构详情(通过ID)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "培训机构ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/"+ISystemConstant.APP_RELEASE_SUFFIX+"/{applyId}")
public InstitutionDTO get( @PathVariable("applyId") String applyId) {
return iInstitutionService.get(applyId);
}
}

View File

@ -28,6 +28,16 @@
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<div class="layui-inline layui-form search-item">
<select id="applyAuditStates" name="applyAuditStates" lay-search>
<option value="">查看全部</option>
<option value="0">待审核</option>
<option value="1">用户撤回</option>
<option value="2">审核通过</option>
<option value="3">报名完成</option>
<option value="-1">审核不通过</option>
</select>
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
@ -242,7 +252,8 @@
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
endTime: $('#endTime').val(),
applyAuditStates:$('#applyAuditStates').val()
},
page: {
curr: currentPage