update backend
This commit is contained in:
@ -81,7 +81,7 @@ func (h *ArticleHandler) parseListQuery(c *gin.Context) dto.ArticleQuery {
|
||||
|
||||
// Detail 走秀详情(含完整图片集)。
|
||||
//
|
||||
// GET /api/public/runways/:id
|
||||
// GET /api/v1/public/runway-looks/:id
|
||||
// :id 是对外编码串(无序),需先解码为数字主键再查库;非法串视为不存在。
|
||||
func (h *ArticleHandler) Detail(c *gin.Context) {
|
||||
raw := strings.TrimSpace(c.Param("id"))
|
||||
|
||||
@ -42,7 +42,7 @@ func (h *AuthHandler) Me(c *gin.Context) {
|
||||
|
||||
// Login 账号登录,校验账号密码后签发 access + refresh 双令牌。
|
||||
//
|
||||
// POST /api/auth/login
|
||||
// POST /api/v1/auth/login
|
||||
// body: { account, password }
|
||||
// 成功:200 { access_token, refresh_token, expires_in, user }
|
||||
func (h *AuthHandler) Login(c *gin.Context) {
|
||||
@ -67,7 +67,7 @@ func (h *AuthHandler) Login(c *gin.Context) {
|
||||
|
||||
// Refresh 用 refresh token 换取新的 access token。
|
||||
//
|
||||
// POST /api/auth/refresh
|
||||
// POST /api/v1/auth/refresh
|
||||
// body: { refresh_token }
|
||||
// 成功:200 { access_token, expires_in }
|
||||
func (h *AuthHandler) Refresh(c *gin.Context) {
|
||||
|
||||
@ -448,7 +448,7 @@ func (h *BackstageHandler) ReviewReject(c *gin.Context) {
|
||||
c.Redirect(http.StatusFound, reviewListURL(kind))
|
||||
}
|
||||
|
||||
// ReviewDraftImageDelete 软删审核草稿里的单张图片(审核阶段剔除坏图,不删七牛文件)。
|
||||
// ReviewDraftImageDelete 软删审核草稿里的单张图片(审核阶段剔除坏图,不删S4文件)。
|
||||
// 校验 kind 合法后委派给审核服务,成功后跳回草稿详情页。
|
||||
func (h *BackstageHandler) ReviewDraftImageDelete(c *gin.Context) {
|
||||
kind := c.Param("kind")
|
||||
@ -903,7 +903,7 @@ button{padding:7px 12px;background:#111;color:#fff;border:0;border-radius:6px;cu
|
||||
<div class="bar"><span>管理后台 · 用户管理</span><span><a href="/admin/">返回首页</a> · <a href="/admin/logout">退出</a></span></div>
|
||||
<div class="main">
|
||||
<h1>用户管理({{len .Users}})</h1>
|
||||
<p class="muted">VIP 用户在图集详情页可看高清原图,普通 / 未登录用户只看 normal 普通图。</p>
|
||||
<p class="muted">图片质量模型已统一:所有用户(含未登录)看图集详情均走同一高清样式,不再按等级分级。</p>
|
||||
<table>
|
||||
<thead><tr><th>ID</th><th>用户名</th><th>邮箱</th><th>等级</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
@ -916,7 +916,7 @@ button{padding:7px 12px;background:#111;color:#fff;border:0;border-radius:6px;cu
|
||||
<form class="tier" method="post" action="/admin/users/{{.ID}}/tier">
|
||||
<select name="tier">
|
||||
<option value="free" {{if eq .Tier "free"}}selected{{end}}>free(普通)</option>
|
||||
<option value="vip" {{if eq .Tier "vip"}}selected{{end}}>vip(高清)</option>
|
||||
<option value="vip" {{if eq .Tier "vip"}}selected{{end}}>vip</option>
|
||||
</select>
|
||||
<button type="submit">保存</button>
|
||||
</form>
|
||||
@ -1341,7 +1341,7 @@ button.reject{background:#c0392b}
|
||||
<form method="post" action="/admin/runways/{{.UID}}/toggle" style="margin-top:22px">
|
||||
{{if .IsDown}}<input type="hidden" name="deleted" value="0"><button type="submit">重新上架</button>{{else}}<input type="hidden" name="deleted" value="1"><button type="submit" class="reject">下架(对外不可见)</button>{{end}}
|
||||
</form>
|
||||
<p class="muted" style="margin-top:10px">下架会级联软删全部图片,并异步把七牛孤儿图清理任务入队(按引用计数判定,共享图不误删)。</p>
|
||||
<p class="muted" style="margin-top:10px">下架会级联软删全部图片,并异步把S4孤儿图清理任务入队(按引用计数判定,共享图不误删)。</p>
|
||||
</div></body></html>`
|
||||
|
||||
const tplSnapEdit = `<!doctype html><html lang="zh"><head><meta charset="utf-8">
|
||||
@ -1391,7 +1391,7 @@ button.reject{background:#c0392b}
|
||||
<form method="post" action="/admin/street-snaps/{{.UID}}/toggle" style="margin-top:22px">
|
||||
{{if .IsDown}}<input type="hidden" name="deleted" value="0"><button type="submit">重新上架</button>{{else}}<input type="hidden" name="deleted" value="1"><button type="submit" class="reject">下架(对外不可见)</button>{{end}}
|
||||
</form>
|
||||
<p class="muted" style="margin-top:10px">下架会级联软删全部图片,并异步把七牛孤儿图清理任务入队(按引用计数判定,共享图不误删)。</p>
|
||||
<p class="muted" style="margin-top:10px">下架会级联软删全部图片,并异步把S4孤儿图清理任务入队(按引用计数判定,共享图不误删)。</p>
|
||||
</div></body></html>`
|
||||
|
||||
const tplIngestJobs = `<!doctype html><html lang="zh"><head><meta charset="utf-8">
|
||||
|
||||
@ -23,7 +23,7 @@ func NewBrandHandler(brands service.BrandService) *BrandHandler {
|
||||
|
||||
// List 品牌列表(A-Z 字母索引 / 搜索 / 分页)。
|
||||
//
|
||||
// GET /api/public/brands
|
||||
// GET /api/v1/public/brands
|
||||
//
|
||||
// 查询参数:
|
||||
// - letter A-Z 字母;other 表示中文分桶;缺省返回全部拉丁字母开头的品牌
|
||||
|
||||
@ -48,7 +48,7 @@ func (h *HistoryHandler) List(c *gin.Context) {
|
||||
// Record 记录一次浏览(点开文章详情;upsert:同文章刷新时间,不新增行)。
|
||||
//
|
||||
// POST /api/v1/me/history
|
||||
// body: { target_uid } // 带 r=/s= 前缀的对外编码串
|
||||
// body: { target_uid } // 类型进密码、无前缀的对外编码串
|
||||
// 成功:200 { data: { ok: true } }
|
||||
func (h *HistoryHandler) Record(c *gin.Context) {
|
||||
userID, ok := middleware.UserIDFrom(c)
|
||||
|
||||
@ -27,12 +27,12 @@ func NewStreetSnapHandler(svc service.StreetSnapService, favs service.FavoriteSe
|
||||
|
||||
// List 街拍列表(分页 + 排序 + 年份过滤)。
|
||||
//
|
||||
// GET /api/public/street-snaps
|
||||
// GET /api/v1/public/street-snaps
|
||||
//
|
||||
// 查询参数:
|
||||
// - page 页码,默认 1(服务端固定每页 StreetSnapFixedSize=24 条)
|
||||
// - year 年份(整数),0 表示不过滤
|
||||
// - city 地区/城市(精确匹配 city 列),” 表示不过滤
|
||||
// - city 地区/城市(精确匹配 city 列),"" 表示不过滤
|
||||
// - sort image_count(默认,按图片数降序)/ year_desc / year_asc
|
||||
// - locale cn / en
|
||||
//
|
||||
@ -65,7 +65,7 @@ func (h *StreetSnapHandler) parseListQuery(c *gin.Context) dto.StreetSnapQuery {
|
||||
|
||||
// Detail 街拍详情(含完整图片集)。
|
||||
//
|
||||
// GET /api/public/street-snaps/:id
|
||||
// GET /api/v1/public/street-snaps/:id
|
||||
// :id 是对外编码串(无序),需先解码为数字主键再查库;非法串视为不存在。
|
||||
// 不走前端 JS 签名,单独挂载(与 runway 详情一致),单篇枚举防护由 HashID 承担。
|
||||
func (h *StreetSnapHandler) Detail(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user