Commit 7a14cfad by xieshixiang

接口定义

parent efd9a41e
......@@ -10,7 +10,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo;
import com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -70,7 +69,6 @@ public class BindInfoControlller extends BaseController {
return mapper.updateById(info) > 0 ? Result.successResult() : Result.errorResult();
}
/**
* 绑定信息查询接口
*
......@@ -100,12 +98,41 @@ public class BindInfoControlller extends BaseController {
if (query == null) {
return Result.errorResult(ResultCode.PARAMETER_ERROR, "鉴权失败");
}
PageResult<BindInfo> bindInfos = mapper.selectByQuery(query);
return bindInfos.getAllCount() > 0 ? Result.successResult(bindInfos) :
Result.errorResult(ResultCode.HASH_NO_PRIVILEGE);
return service.yearCheckInfo(query);
}
/**
* 驾照信息查询接口
*
* @param query
* @return Result
* @author: xsx
* @date: 2020/6/19 16:28
*/
@PostMapping("violationInfo")
public Result violationInfo(@RequestBody BindInfoQuery query) {
if (query == null) {
return Result.errorResult(ResultCode.PARAMETER_ERROR, "鉴权失败");
}
return service.violationInfo(query);
}
@PostMapping("insuranceInfo")
public Result insuranceInfo(@RequestBody BindInfoQuery query){
if (query == null) {
return Result.errorResult(ResultCode.PARAMETER_ERROR, "鉴权失败");
}
return service.insuranceInfo(query);
}
/**
* 驾照信息查询接口
*
* @param query
* @return Result
* @author: xsx
* @date: 2020/6/19 16:28
*/
@PostMapping("drivingLicenseInfo")
public Result drivingLicenseInfo(@RequestBody BindInfoQuery query) {
if (query == null) {
......@@ -115,10 +142,4 @@ public class BindInfoControlller extends BaseController {
}
}
......@@ -23,10 +23,22 @@ public interface IBindService extends IService<BindInfo> {
*/
Result bind(BindInfo info);
/**
* 年检信息查询接口
*
* @param query
* @return
*/
Result yearCheckInfo(BindInfoQuery query);
/**
* 保险信息查询接口
* @param query
* @return
*/
Result insuranceInfo(BindInfoQuery query);
/**
* 违法信息查询接口
*
* @param query
......@@ -36,7 +48,14 @@ public interface IBindService extends IService<BindInfo> {
*/
Result violationInfo(BindInfoQuery query);
/**
* 驾照信息查询接口
*
* @param query
* @return Result
* @author: xsx
* @date: 2020/6/19 16:29
*/
Result drivingLicenseInfo(BindInfoQuery query);
}
......@@ -79,7 +79,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
if (bindInfo==null || "0".equals(bindInfo.getStatus())){
return Result.errorResult(ResultCode.DATA_ERROR,"车辆绑定信息不存在,或已过期!");
}
return Result.successResult();
return null;
}
@Override
public Result insuranceInfo(BindInfoQuery query) {
BindInfo bindInfo = mapper.selectById(query.getUnqId());
if (bindInfo==null || "0".equals(bindInfo.getStatus())){
return Result.errorResult(ResultCode.DATA_ERROR,"车辆绑定信息不存在,或已过期!");
}
return null;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment