记得上下班打卡 | git大法好,push需谨慎

Commit 13107e71 authored by wangyifan's avatar wangyifan

Merge branch 'dev-caomeihuizhang' into container-test

parents fc707e10 c43bc066
...@@ -78,4 +78,6 @@ ALTER TABLE `adam_caomei_badge` ADD COLUMN `sort` int(11) NOT NULL DEFAULT 0 COM ...@@ -78,4 +78,6 @@ ALTER TABLE `adam_caomei_badge` ADD COLUMN `sort` int(11) NOT NULL DEFAULT 0 COM
ALTER TABLE `adam_caomei_badge` ADD COLUMN `share_text` varchar(255) NOT NULL DEFAULT '' COMMENT '徽章分享文案' AFTER `sort`; ALTER TABLE `adam_caomei_badge` ADD COLUMN `share_text` varchar(255) NOT NULL DEFAULT '' COMMENT '徽章分享文案' AFTER `sort`;
-- 2026-04-23 新增徽章副标题字段 -- 2026-04-23 新增徽章副标题字段
ALTER TABLE `adam_caomei_badge` ADD COLUMN `sub_title` varchar(32) NOT NULL DEFAULT '' COMMENT '徽章副标题(最多20字)' AFTER `name`; ALTER TABLE `adam_caomei_badge` ADD COLUMN `sub_title` varchar(32) NOT NULL DEFAULT '' COMMENT '徽章副标题(最多20字)' AFTER `name`;
\ No newline at end of file
-- TODO 上线前需要运行:adam_caomei_passport_inserts_BATCH-CAOMEI-B1.sql
\ No newline at end of file
...@@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data @Data
@ApiModel("草莓徽章-认领参数") @ApiModel("草莓徽章-认领参数")
public class AdamCaomeiBadgeClaimParam { public class AdamCaomeiBadgeClaimParam {
@NotBlank(message = "徽章ID不能为空") @NotEmpty(message = "徽章ID列表不能为空")
@ApiModelProperty(value = "徽章ID", required = true) @ApiModelProperty(value = "徽章ID列表", required = true)
private String badgeId; private List<@NotBlank(message = "徽章ID不能为空") String> badgeIds;
} }
...@@ -14,7 +14,7 @@ public interface IAdamCaomeiBadgeUserService { ...@@ -14,7 +14,7 @@ public interface IAdamCaomeiBadgeUserService {
/** /**
* 认领徽章 * 认领徽章
*/ */
ResponseDto<String> claimBadge(String badgeId, String uid); ResponseDto<List<String>> claimBadges(List<String> badgeIds, String uid);
/** /**
* 补签申请记录列表(用户端) * 补签申请记录列表(用户端)
......
...@@ -87,6 +87,18 @@ public interface AdamCaomeiBadgeMapper extends BaseMapper<AdamCaomeiBadge> { ...@@ -87,6 +87,18 @@ public interface AdamCaomeiBadgeMapper extends BaseMapper<AdamCaomeiBadge> {
@Select("select count(1) from adam_caomei_user_badge where user_id = #{userId} and badge_id = #{badgeId}") @Select("select count(1) from adam_caomei_user_badge where user_id = #{userId} and badge_id = #{badgeId}")
int checkUserBadgeExists(@Param("userId") String userId, @Param("badgeId") String badgeId); int checkUserBadgeExists(@Param("userId") String userId, @Param("badgeId") String badgeId);
@Select({
"<script>",
"select badge_id from adam_caomei_user_badge",
"where user_id = #{userId} and badge_id in",
"<foreach collection='badgeIds' item='badgeId' open='(' separator=',' close=')'>",
"#{badgeId}",
"</foreach>",
"</script>"
})
List<String> selectClaimedBadgeIdsByUserAndBadgeIds(@Param("userId") String userId,
@Param("badgeIds") List<String> badgeIds);
@Insert({ @Insert({
"insert into adam_caomei_user_badge (user_id, badge_id, source, created_at) ", "insert into adam_caomei_user_badge (user_id, badge_id, source, created_at) ",
"values (#{userId}, #{badgeId}, #{source}, now())" "values (#{userId}, #{badgeId}, #{source}, now())"
......
...@@ -36,9 +36,9 @@ public class AdamCaomeiBadgeUserController { ...@@ -36,9 +36,9 @@ public class AdamCaomeiBadgeUserController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation("认领徽章") @ApiOperation("认领徽章")
@PostMapping("claim") @PostMapping("claim")
public ResponseDto<String> claim(@Valid @RequestBody AdamCaomeiBadgeClaimParam param) { public ResponseDto<List<String>> claim(@Valid @RequestBody AdamCaomeiBadgeClaimParam param) {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
return adamCaomeiBadgeUserService.claimBadge(param.getBadgeId(), uid); return adamCaomeiBadgeUserService.claimBadges(param.getBadgeIds(), uid);
} }
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
......
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