新增AI教练模块,包括控制器、服务、模型及数据传输对象,更新应用模块以引入新模块,同时在打卡模块中添加按时间范围返回每日打卡状态的功能
This commit is contained in:
@@ -30,6 +30,7 @@ import { CurrentUser } from '../common/decorators/current-user.decorator';
|
||||
import { AccessTokenPayload } from './services/apple-auth.service';
|
||||
import { JwtAuthGuard } from 'src/common/guards/jwt-auth.guard';
|
||||
import { ResponseCode } from 'src/base.dto';
|
||||
import { CosService } from './cos.service';
|
||||
|
||||
|
||||
@ApiTags('users')
|
||||
@@ -39,6 +40,7 @@ export class UsersController {
|
||||
constructor(
|
||||
private readonly usersService: UsersService,
|
||||
@Inject(WINSTON_MODULE_PROVIDER) private readonly winstonLogger: WinstonLogger,
|
||||
private readonly cosService: CosService,
|
||||
) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@@ -118,6 +120,26 @@ export class UsersController {
|
||||
return this.usersService.refreshGuestToken(refreshGuestTokenDto);
|
||||
}
|
||||
|
||||
// 获取COS上传临时密钥
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('cos/upload-token')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: '获取COS上传临时密钥' })
|
||||
async getCosUploadToken(@CurrentUser() user: AccessTokenPayload) {
|
||||
try {
|
||||
const data = await this.cosService.getUploadToken(user.sub);
|
||||
return { code: ResponseCode.SUCCESS, message: 'success', data };
|
||||
} catch (error) {
|
||||
this.winstonLogger.error('获取COS上传临时密钥失败', {
|
||||
context: 'UsersController',
|
||||
userId: user?.sub,
|
||||
error: (error as Error).message,
|
||||
stack: (error as Error).stack,
|
||||
});
|
||||
return { code: ResponseCode.ERROR, message: (error as Error).message };
|
||||
}
|
||||
}
|
||||
|
||||
// App Store 服务器通知接收接口
|
||||
@Public()
|
||||
@Post('app-store-notifications')
|
||||
|
||||
Reference in New Issue
Block a user