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

Commit ad802524 authored by wangyifan's avatar wangyifan

草莓护照- 添加分享文案字段

parent f5cb95d4
...@@ -72,4 +72,7 @@ CREATE TABLE `adam_caomei_badge_apply_record` ( ...@@ -72,4 +72,7 @@ CREATE TABLE `adam_caomei_badge_apply_record` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='草莓护照-徽章补签申请记录表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='草莓护照-徽章补签申请记录表';
-- 2026-04-13 新增排序字段 -- 2026-04-13 新增排序字段
ALTER TABLE `adam_caomei_badge` ADD COLUMN `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序值,数值越大越靠前' AFTER `display_status`; ALTER TABLE `adam_caomei_badge` ADD COLUMN `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序值,数值越大越靠前' AFTER `display_status`;
\ No newline at end of file
-- 2026-04-16 新增分享文案字段
ALTER TABLE `adam_caomei_badge` ADD COLUMN `share_text` varchar(255) NOT NULL DEFAULT '' COMMENT '徽章分享文案' AFTER `sort`;
\ No newline at end of file
...@@ -34,4 +34,7 @@ public class AdamCaomeiBadgeParam { ...@@ -34,4 +34,7 @@ public class AdamCaomeiBadgeParam {
@ApiModelProperty(value = "排序值,数值越大越靠前") @ApiModelProperty(value = "排序值,数值越大越靠前")
private Integer sort; private Integer sort;
@ApiModelProperty(value = "徽章分享文案")
private String shareText;
} }
...@@ -37,6 +37,9 @@ public class AdamCaomeiBadgeVo { ...@@ -37,6 +37,9 @@ public class AdamCaomeiBadgeVo {
@ApiModelProperty(value = "排序值,数值越大越靠前") @ApiModelProperty(value = "排序值,数值越大越靠前")
private Integer sort; private Integer sort;
@ApiModelProperty(value = "徽章分享文案")
private String shareText;
@ApiModelProperty(value = "添加时间") @ApiModelProperty(value = "添加时间")
private Date createdAt; private Date createdAt;
......
...@@ -21,6 +21,9 @@ public class AdamCaomeiPassportBadgeShelfItemVo { ...@@ -21,6 +21,9 @@ public class AdamCaomeiPassportBadgeShelfItemVo {
@ApiModelProperty("图标") @ApiModelProperty("图标")
private String icon; private String icon;
@ApiModelProperty("分享文案")
private String shareText;
@ApiModelProperty("类型 1护照 2演出 3特殊") @ApiModelProperty("类型 1护照 2演出 3特殊")
private Integer type; private Integer type;
......
...@@ -21,6 +21,9 @@ public class AdamCaomeiPassportUserClaimedBadgeVo { ...@@ -21,6 +21,9 @@ public class AdamCaomeiPassportUserClaimedBadgeVo {
@ApiModelProperty("图标") @ApiModelProperty("图标")
private String icon; private String icon;
@ApiModelProperty("分享文案")
private String shareText;
@ApiModelProperty("类型 1护照类型徽章 2演出类型徽章 3特殊徽章") @ApiModelProperty("类型 1护照类型徽章 2演出类型徽章 3特殊徽章")
private Integer type; private Integer type;
......
...@@ -61,6 +61,7 @@ public class AdamCaomeiBadgeController extends BaseController { ...@@ -61,6 +61,7 @@ public class AdamCaomeiBadgeController extends BaseController {
public AjaxResult addSave(AdamCaomeiBadgeParam param) { public AjaxResult addSave(AdamCaomeiBadgeParam param) {
AdamCaomeiBadge badge = new AdamCaomeiBadge(); AdamCaomeiBadge badge = new AdamCaomeiBadge();
BeanUtils.copyProperties(param, badge); BeanUtils.copyProperties(param, badge);
badge.setShareText(StringUtils.defaultString(badge.getShareText()));
badge.setBadgeId(IDGenerator.nextSnowId()); badge.setBadgeId(IDGenerator.nextSnowId());
badge.setDisplayStatus(0); // 默认下架 badge.setDisplayStatus(0); // 默认下架
if (badge.getSort() == null) { if (badge.getSort() == null) {
...@@ -130,6 +131,7 @@ public class AdamCaomeiBadgeController extends BaseController { ...@@ -130,6 +131,7 @@ public class AdamCaomeiBadgeController extends BaseController {
} }
AdamCaomeiBadge badge = new AdamCaomeiBadge(); AdamCaomeiBadge badge = new AdamCaomeiBadge();
BeanUtils.copyProperties(param, badge); BeanUtils.copyProperties(param, badge);
badge.setShareText(StringUtils.defaultString(badge.getShareText()));
badge.setMid(oldBadge.getMid()); badge.setMid(oldBadge.getMid());
badge.setUpdatedAt(new java.util.Date()); badge.setUpdatedAt(new java.util.Date());
if (badge.getType() != null && badge.getType() != 2) { if (badge.getType() != null && badge.getType() != 2) {
......
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
<input name="sort" class="form-control" type="number" min="0" value="0" placeholder="数值越大越靠前"> <input name="sort" class="form-control" type="number" min="0" value="0" placeholder="数值越大越靠前">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">分享文案:</label>
<div class="col-sm-8">
<textarea name="shareText" class="form-control" rows="3" maxlength="255" placeholder="请输入徽章分享文案"></textarea>
</div>
</div>
<div class="form-group" id="ticketTimesDiv" style="display: none;"> <div class="form-group" id="ticketTimesDiv" style="display: none;">
<label class="col-sm-3 control-label is-required">关联演出:</label> <label class="col-sm-3 control-label is-required">关联演出:</label>
<div class="col-sm-8"> <div class="col-sm-8">
......
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
<div class="form-control-static" th:text="*{sort}"></div> <div class="form-control-static" th:text="*{sort}"></div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">分享文案:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="*{shareText}"></div>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
......
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
<input name="sort" th:field="*{sort}" class="form-control" type="number" min="0" placeholder="数值越大越靠前"> <input name="sort" th:field="*{sort}" class="form-control" type="number" min="0" placeholder="数值越大越靠前">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">分享文案:</label>
<div class="col-sm-8">
<textarea name="shareText" th:field="*{shareText}" class="form-control" rows="3" maxlength="255" placeholder="请输入徽章分享文案"></textarea>
</div>
</div>
<div class="form-group" id="ticketTimesDiv" th:style="${badge.type == 2 ? 'display:block;' : 'display:none;'}"> <div class="form-group" id="ticketTimesDiv" th:style="${badge.type == 2 ? 'display:block;' : 'display:none;'}">
<label class="col-sm-3 control-label is-required">关联演出:</label> <label class="col-sm-3 control-label is-required">关联演出:</label>
<div class="col-sm-8"> <div class="col-sm-8">
......
...@@ -9,6 +9,7 @@ public class AdamCaomeiPassportUserBadgeDto { ...@@ -9,6 +9,7 @@ public class AdamCaomeiPassportUserBadgeDto {
private String badgeId; private String badgeId;
private String badgeName; private String badgeName;
private String icon; private String icon;
private String shareText;
private Integer type; private Integer type;
private Date claimedAt; private Date claimedAt;
private Integer source; private Integer source;
......
...@@ -58,6 +58,11 @@ public class AdamCaomeiBadge implements Serializable { ...@@ -58,6 +58,11 @@ public class AdamCaomeiBadge implements Serializable {
*/ */
private Integer sort; private Integer sort;
/**
* 徽章分享文案
*/
private String shareText;
/** /**
* 添加时间 * 添加时间
*/ */
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
ub.badge_id AS badgeId, ub.badge_id AS badgeId,
IFNULL(b.name, '') AS badgeName, IFNULL(b.name, '') AS badgeName,
IFNULL(b.icon, '') AS icon, IFNULL(b.icon, '') AS icon,
IFNULL(b.share_text, '') AS shareText,
IFNULL(b.type, 0) AS type, IFNULL(b.type, 0) AS type,
ub.created_at AS claimedAt, ub.created_at AS claimedAt,
ub.source AS source ub.source AS source
......
...@@ -107,6 +107,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse ...@@ -107,6 +107,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse
v.setBadgeId(b.getBadgeId()); v.setBadgeId(b.getBadgeId());
v.setName(StringUtils.defaultString(b.getName())); v.setName(StringUtils.defaultString(b.getName()));
v.setIcon(StringUtils.defaultString(b.getIcon())); v.setIcon(StringUtils.defaultString(b.getIcon()));
v.setShareText(StringUtils.defaultString(b.getShareText()));
v.setType(b.getType()); v.setType(b.getType());
v.setClaimedAt(grantAt); v.setClaimedAt(grantAt);
v.setSource(1); v.setSource(1);
...@@ -235,6 +236,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse ...@@ -235,6 +236,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse
v.setBadgeId(r.getBadgeId()); v.setBadgeId(r.getBadgeId());
v.setName(StringUtils.defaultString(r.getBadgeName())); v.setName(StringUtils.defaultString(r.getBadgeName()));
v.setIcon(StringUtils.defaultString(r.getIcon())); v.setIcon(StringUtils.defaultString(r.getIcon()));
v.setShareText(StringUtils.defaultString(r.getShareText()));
v.setType(r.getType()); v.setType(r.getType());
v.setClaimedAt(r.getClaimedAt()); v.setClaimedAt(r.getClaimedAt());
v.setSource(r.getSource()); v.setSource(r.getSource());
...@@ -275,6 +277,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse ...@@ -275,6 +277,7 @@ public class AdamCaomeiPassportUserServiceImpl implements IAdamCaomeiPassportUse
v.setBadgeId(b.getBadgeId()); v.setBadgeId(b.getBadgeId());
v.setName(StringUtils.defaultString(b.getName())); v.setName(StringUtils.defaultString(b.getName()));
v.setIcon(StringUtils.defaultString(b.getIcon())); v.setIcon(StringUtils.defaultString(b.getIcon()));
v.setShareText(StringUtils.defaultString(b.getShareText()));
v.setType(b.getType()); v.setType(b.getType());
v.setPerformanceId(StringUtils.defaultString(b.getPerformanceId())); v.setPerformanceId(StringUtils.defaultString(b.getPerformanceId()));
v.setApplyPending(false); v.setApplyPending(false);
......
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