v4.0.9版本更新-门店分类支持多选
CI / verify (pull_request) Waiting to run

This commit is contained in:
2026-09-02 11:12:51 +08:00
parent 77e9917a18
commit fe557c912d
18 changed files with 742 additions and 239 deletions
@@ -1,4 +1,4 @@
import { Body, Controller, Get, Param, Post, Put, Query, UseGuards } from '@nestjs/common';
import { Body, Controller, Delete, Get, Param, Post, Put, Query, UseGuards } from '@nestjs/common';
import { StoreService } from './store.service';
import { StoreCategoryService } from './store-category.service';
import { RedeemService } from '../redeem/redeem.service';
@@ -109,41 +109,51 @@ export class PartnerStoreController {
}
@Get(':id')
async detail(@CurrentUser() user: AuthUser, @Param('id') id: string) {
return this.storeService.partnerGetStore(user.actorId, BigInt(id));
}
async detail(@CurrentUser() user: AuthUser, @Param('id') id: string) {
return this.storeService.partnerGetStore(user.actorId, BigInt(id));
}
@Get(':id/categories')
async getCategories(@CurrentUser() user: AuthUser, @Param('id') id: string) {
return this.storeService.getStoreCategories(BigInt(id));
}
@Get(':id/categories')
async getCategories(@CurrentUser() user: AuthUser, @Param('id') id: string) {
return this.storeService.partnerGetStoreCategories(user.actorId, BigInt(id));
}
@Post(':id/categories')
async assignCategory(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Body() body: { categoryId: string; priority?: number },
) {
return this.storeService.assignCategoryToStore(BigInt(id), body.categoryId, body.priority);
}
@Post(':id/categories')
async assignCategory(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Body() body: { categoryId: string; priority?: number },
) {
return this.storeService.partnerAssignCategoryToStore(
user.actorId,
BigInt(id),
body.categoryId,
body.priority,
);
}
@Delete(':id/categories/:categoryId')
async removeCategory(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Param('categoryId') categoryId: string,
) {
return this.storeService.removeCategoryFromStore(BigInt(id), categoryId);
}
@Delete(':id/categories/:categoryId')
async removeCategory(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Param('categoryId') categoryId: string,
) {
return this.storeService.partnerRemoveCategoryFromStore(user.actorId, BigInt(id), categoryId);
}
@Put(':id/categories')
async replaceCategories(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Body() body: { categoryIds: string[]; priorities?: Record<string, number> },
) {
return this.storeService.replaceStoreCategories(BigInt(id), body.categoryIds, body.priorities);
}
@Put(':id/categories')
async replaceCategories(
@CurrentUser() user: AuthUser,
@Param('id') id: string,
@Body() body: { categoryIds: string[]; priorities?: Record<string, number> },
) {
return this.storeService.partnerReplaceStoreCategories(
user.actorId,
BigInt(id),
body.categoryIds,
body.priorities,
);
}
@Post()
create(@CurrentUser() user: AuthUser, @Body() body: Record<string, unknown>) {