Commit ce12749e by lijiabin

【需求 20331】 wip: 加入相关接口

parent d0891e7c
import type { GoodsDistributionTypeEnum } from '@/constants'
import type { PageSearchParams } from '@/utils/request/types'
export interface BackendColumnSearchParams extends PageSearchParams {
type: string
......@@ -24,4 +25,5 @@ export interface BackendColumnListItemDto {
status: number
title: string
type: string
sourceType: GoodsDistributionTypeEnum
}
......@@ -6,6 +6,7 @@ import type {
BackendShopListSearchParams,
} from './types'
import type { BackendServicePageResult } from '@/utils/request/types'
import { GoodsDistributionTypeEnum } from '@/constants'
// 后台管理 积分商城相关接口
/**
......@@ -53,7 +54,12 @@ export const getBackendExchangeList = (data: BackendExchangeListSearchParams) =>
/**
* 发放 取消发放
*/
export const issueProduct = (data: { id: number; status: number; memo?: string }) => {
export const issueProduct = (data: {
id: number
status: number
memo?: string
sourceType: GoodsDistributionTypeEnum
}) => {
return service.request({
url: `/api/culture/shop/order/issueProduct`,
method: 'POST',
......
import type { PageSearchParams } from '@/utils/request/types'
import { ShopGoodsTypeEnum } from '@/constants'
import { GoodsDistributionTypeEnum, ShopGoodsTypeEnum } from '@/constants'
export interface BackendShopListSearchParams extends PageSearchParams {
name?: string
itemType?: ShopGoodsTypeEnum
......@@ -21,7 +21,7 @@ export interface BackendShopItemDto {
memo: string
num: number
price: number
source: null
sourceType: GoodsDistributionTypeEnum
status: number
userId: number
userName: string
......@@ -37,7 +37,7 @@ export interface AddOrUpdateShopItemDto {
status: number
}
export interface BackendExchangeListSearchParams extends PageSearchParams {
source: string
sourceType?: GoodsDistributionTypeEnum
status?: 0 | 1 | 2
itemName?: string
}
......@@ -29,7 +29,7 @@ export interface UserAccountDataDto {
}
/**
* 用户信息记录
* 用户信息记录 -- 当日是否签到 是否观看过cg 服务器时间
*/
export interface UserRecordDataDto {
actionType: null
......@@ -41,11 +41,14 @@ export interface UserRecordDataDto {
incrText: null
isDelete: null
isIncr: null
isSign: BooleanFlag
relationId: null
remark: null
scoreAyabi: null
scoreExp: null
subType: null
userId: null
isSign: BooleanFlag
isView: BooleanFlag
isViewGuide: BooleanFlag
currentTime: number
}
......@@ -14,6 +14,7 @@ export * from './online'
export * from './otherUserPage'
export * from './auction'
export * from './dailyLottery'
export * from './launchCampaign'
// 导出类型
export * from './task/types'
export * from './shop/types'
......@@ -30,3 +31,4 @@ export * from './online/types'
export * from './otherUserPage/types'
export * from './auction/types'
export * from './dailyLottery/types'
export * from './launchCampaign/types'
import service from '@/utils/request/index'
import type { SurveySubmitData } from './types'
import type { UserLaunchCampaignStatusDataDto } from './types'
// 项目首次上线相关的活动接口
/**
* 用户是否观看首页CG引导
*/
export const getUserLaunchCampaignStatus = () => {
return service.request<UserLaunchCampaignStatusDataDto>({
url: '/api/yaCulture/confirm/viewData',
method: 'POST',
data: {},
})
}
/**
* 标记用户已经观看过CG 或 普通动画引导
*/
export const markUserGuide = (pageKey: 'isView' | 'isViewGuide') => {
return service.request({
url: '/api/yaCulture/confirm/view',
method: 'POST',
data: { pageKey },
})
}
/**
* 用户点击相关奖励按钮 true: 第一次进入 跳出相关动画 false: 已经进入过 不跳出动画
*/
export const markUserClickedRewardButton = (pageKey: string) => {
return service.request({
url: '/api/yaCulture/first/view',
method: 'POST',
data: { pageKey },
})
}
/**
* 获取活动配置(双倍亚币、活动期间等)
* TODO: 对接后端真实接口
*/
export const getActivityConfig = () => {
return service.request({
url: '/api/culture/activity/config',
method: 'GET',
})
}
/**
* 获取CG引导观看状态
* TODO: 对接后端真实接口
*/
export const getCgGuideStatus = () => {
return service.request({
url: '/api/culture/activity/cg-guide/status',
method: 'GET',
})
}
/**
* 标记CG引导已观看 + 领取奖励(碎片+1, 亚币+2)
* TODO: 对接后端真实接口
*/
export const completeCgGuide = () => {
return service.request({
url: '/api/culture/activity/cg-guide/complete',
method: 'POST',
})
}
/**
* 领取碎片页面奖励(碎片+1, 亚币+2)
* TODO: 对接后端真实接口
*/
export const claimFragmentReward = (pageKey: string) => {
return service.request({
url: '/api/culture/activity/fragment/claim',
method: 'POST',
data: { pageKey },
})
}
/**
* 获取碎片奖励状态(某页面是否已领取)
* TODO: 对接后端真实接口
*/
export const getFragmentRewardStatus = (pageKey: string) => {
return service.request({
url: '/api/culture/activity/fragment/status',
method: 'GET',
params: { pageKey },
})
}
/**
* 获取满意度问卷配置
* TODO: 对接后端真实接口
*/
export const getSurveyConfig = () => {
return service.request({
url: '/api/culture/activity/survey/config',
method: 'GET',
})
}
/**
* 提交满意度问卷
* TODO: 对接后端真实接口
*/
export const submitSurvey = (data: SurveySubmitData) => {
return service.request({
url: '/api/culture/activity/survey/submit',
method: 'POST',
data,
})
}
import type { BooleanFlag } from '@/constants'
/** 用户是否观看首页CG引导等相关数据 */
export interface UserLaunchCampaignStatusDataDto {
/** 是否已观看CG */
isView: BooleanFlag
/** 服务器时间 */
currentTime: number
/** 是否已观看普通动画引导 */
isViewGuide: BooleanFlag
}
/** 活动配置信息 */
export interface ActivityConfigDto {
/** 是否处于活动期间 */
isActivityPeriod: boolean
/** 签到是否双倍亚币 */
isDoubleYabi: boolean
/** 双倍亚币倍率 */
doubleMultiplier: number
/** 活动开始时间 */
activityStartTime: string
/** 活动结束时间 */
activityEndTime: string
}
/** CG引导状态 */
export interface CgGuideStatusDto {
/** 是否已观看CG */
hasWatchedCg: boolean
}
/** 碎片奖励记录 */
export interface FragmentRewardDto {
/** 碎片数量 */
fragmentCount: number
/** 亚币数量 */
yabiCount: number
/** 当前页面是否已领取 */
hasClaimedThisPage: boolean
}
/** 满意度问卷配置 */
export interface SurveyConfigDto {
/** 是否在调研期内(上线4周内) */
isInSurveyPeriod: boolean
/** 触发阈值(点击次数) */
clickThreshold: number
/** 用户是否已提交过问卷 */
hasSubmitted: boolean
}
/** 问卷提交数据 */
export interface SurveySubmitData {
/** 满意度评分 1-5 */
rating: number
/** 最喜欢的功能(多选) */
favoriteFeatures: string[]
/** 改进建议 */
suggestion: string
}
/** 碎片奖励可触发的页面 key */
export type RewardPageKey =
| 'askTab'
| 'pointsStore'
| 'auction'
| 'yaTab'
| 'userPage'
| 'articleDetail'
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