浏览代码

查询活动申请 接口

tags/V1.8.0^2
wanghaoran 1年前
父节点
当前提交
b2f906d0a2
共有 4 个文件被更改,包括 48 次插入4 次删除
  1. +14
    -4
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamActivityApplyController.java
  2. +10
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActivityQuery.java
  3. +3
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamActivityApplyService.java
  4. +21
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActivityApplyServiceImpl.java

+ 14
- 4
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamActivityApplyController.java 查看文件

@@ -1,13 +1,11 @@
package com.tuoheng.api.controller;

import com.tuoheng.api.entity.domain.WestreamActivityApply;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.api.service.IWestreamActivityApplyService;
import com.tuoheng.common.utils.JsonResult;
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 org.springframework.web.bind.annotation.*;

/**
* 全民护河志愿者活动 前端控制器
@@ -33,4 +31,16 @@ public class WestreamActivityApplyController {
public JsonResult submit(@RequestBody WestreamActivityApply westreamActivityApply){
return westreamActivityApplyService.submit(westreamActivityApply);
}

/**
* 查询活动申请
*
* @return
*/
@GetMapping("/getApply")
public JsonResult getApply(WestreamActivityQuery query) {
return westreamActivityApplyService.getApply(query);
}

}


+ 10
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActivityQuery.java 查看文件

@@ -19,4 +19,14 @@ public class WestreamActivityQuery extends BaseQuery {
*/
private Integer tenantId;

/**
* 活动id
*/
private Integer activityId;

/**
* openid
*/
private String openid;

}

+ 3
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamActivityApplyService.java 查看文件

@@ -1,10 +1,13 @@
package com.tuoheng.api.service;

import com.tuoheng.api.entity.domain.WestreamActivityApply;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.common.common.IBaseService;
import com.tuoheng.common.utils.JsonResult;

public interface IWestreamActivityApplyService extends IBaseService<WestreamActivityApply> {

JsonResult submit(WestreamActivityApply westreamActivityApply);

JsonResult getApply(WestreamActivityQuery query);
}

+ 21
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActivityApplyServiceImpl.java 查看文件

@@ -2,6 +2,7 @@ package com.tuoheng.api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.api.entity.domain.WestreamActivityApply;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.api.mapper.WestreamActivityApplyMapper;
import com.tuoheng.api.service.IWestreamActivityApplyService;
import com.tuoheng.common.common.BaseServiceImpl;
@@ -40,4 +41,24 @@ public class WestreamActivityApplyServiceImpl extends BaseServiceImpl<WestreamAc

return JsonResult.success();
}

@Override
public JsonResult getApply(WestreamActivityQuery query) {
if (null == query.getTenantId() || StringUtils.isEmpty(query.getOpenid())) {
return JsonResult.error("参数为空!");
}
if (null == query.getActivityId()) {
return JsonResult.error("活动ID为空!");
}

WestreamActivityApply westreamActivityApply = westreamActivityApplyMapper.selectOne(new LambdaQueryWrapper<WestreamActivityApply>()
.eq(WestreamActivityApply::getActivityId, query.getActivityId())
.eq(WestreamActivityApply::getTenantId, query.getTenantId())
.eq(WestreamActivityApply::getOpenid, query.getOpenid())
.eq(WestreamActivityApply::getMark, 1)
.orderByDesc(WestreamActivityApply::getCreateTime)
.last("limit 1"));

return JsonResult.success(westreamActivityApply);
}
}

正在加载...
取消
保存