feat(app-api): E1 补全 5 个 C 端接口(创作者入驻/作品/看板 + 启动配置/公告)
为什么:联调 10-19 开始,前端照 api-phase1.md §1.9 写会 404,需要先把这 5 个补齐。 契约先行(12-上线检查清单 §一):先重写 api-phase1.md §1.9 —— 把 commerce 三条移出本节标"已实现", 补齐 5 个接口的请求/响应字段、错误码、分页口径、幂等矩阵,并新增 200007 CREATOR_NOT_ACTIVE。 - GET /app/config(匿名):硬编码白名单 6 键 + 契约默认值兜底,绝不整表下发 - GET /app/notices(匿名):ops_notice 只读分页(status/target/发布与过期时间),无数据返回空列表 - POST /app/creator/apply:幂等,防重靠 DB 唯一索引 uk_creator_user,并发冲突读回既有记录 - GET /app/creator/works:非生效创作者报 200007 + 分状态提示,不返回空数组冒充成功 - GET /app/creator/stats:与后台 07 看板同口径(字段/notes 逐条一致),null + notes 语义保留 - 冻结模块零改动:module-creator 仅新增 CreatorAppService/两个 VO 与 1 个公开方法 pageMyDramasOf, 既有 pageMyDramas 一行未动;module-system 仅新增 OpsNotice 实体与 Mapper - Swagger 中文注解按 S1 规范补齐;白名单与 /app/notices 加进安全白名单 - 实测:mvn test 98 条全过(app-api 41→56);package 通过;端到端五接口全部符合预期 (重复 apply 同 id + created:false、pending 看 works/stats 报 200007、approved 后正常)
This commit is contained in:
1 parent
4c3d524eff
commit
14b5e4137f
19 files changed
+1355
-11
No files matched your search
+46
@@ -0,0 +1,46 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
package com.fruitshorts.system.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 系统公告(ops_notice)。
|
||||
*
|
||||
* <p>表在 schema-phase1 里就建好了,但一直没有实体/Mapper —— C 端 `/app/notices` 需要读它,这里补上。
|
||||
* **只读使用**:公告的写入(后台发布入口)当前没有产出方,本期不实现。
|
||||
*/
|
||||
@Data
|
||||
@TableName("ops_notice")
|
||||
public class OpsNotice {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
private String title;
|
||||
private String content;
|
||||
|
||||
/** 投放对象:ALL / USER / CREATOR。 */
|
||||
private String target;
|
||||
|
||||
/** 公告类型:SYSTEM / AUDIT / PAYMENT / ACTIVITY。 */
|
||||
private String type;
|
||||
|
||||
/** 1=启用,0=停用。 */
|
||||
private Integer status;
|
||||
|
||||
private LocalDateTime publishAt;
|
||||
private LocalDateTime expireAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
package com.fruitshorts.system.dal.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fruitshorts.system.dal.entity.OpsNotice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/** 系统公告(只读使用)。 */
|
||||
@Mapper
|
||||
public interface OpsNoticeMapper extends BaseMapper<OpsNotice> {
|
||||
}
|
||||
Reference in new issue
Block a user