mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-19 13:13:35 +02:00
chore: add techbase to apps-archived
Integrated techbase (software comparison platform) into monorepo structure: - Created NestJS backend with votes and comments modules - Migrated from external Supabase to own PostgreSQL - Set up Drizzle ORM schema for votes and comments - Created API client replacing Supabase in Astro frontend - Added environment configuration (port 3021) Archived immediately as it's not yet ready for active development. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
17313473aa
commit
34c879929b
161 changed files with 12613 additions and 0 deletions
|
|
@ -0,0 +1,57 @@
|
|||
import { Controller, Post, Get, Patch, Delete, Body, Param, Req } from '@nestjs/common';
|
||||
import { Request } from 'express';
|
||||
import { CommentsService } from './comments.service';
|
||||
import { CreateCommentDto } from './dto/create-comment.dto';
|
||||
|
||||
@Controller('comments')
|
||||
export class CommentsController {
|
||||
constructor(private readonly commentsService: CommentsService) {}
|
||||
|
||||
@Post()
|
||||
async createComment(@Body() createCommentDto: CreateCommentDto, @Req() req: Request) {
|
||||
const ipAddress = req.ip || req.socket.remoteAddress || 'unknown';
|
||||
return this.commentsService.createComment(
|
||||
createCommentDto.softwareId,
|
||||
createCommentDto.userName,
|
||||
createCommentDto.comment,
|
||||
ipAddress
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':softwareId')
|
||||
async getComments(@Param('softwareId') softwareId: string) {
|
||||
return this.commentsService.getApprovedComments(softwareId);
|
||||
}
|
||||
}
|
||||
|
||||
@Controller('admin/comments')
|
||||
export class AdminCommentsController {
|
||||
constructor(private readonly commentsService: CommentsService) {}
|
||||
|
||||
@Get()
|
||||
async getAllComments() {
|
||||
return this.commentsService.getAllComments();
|
||||
}
|
||||
|
||||
@Get('pending')
|
||||
async getPendingComments() {
|
||||
return this.commentsService.getPendingComments();
|
||||
}
|
||||
|
||||
@Patch(':id/approve')
|
||||
async approveComment(@Param('id') id: string) {
|
||||
// TODO: Get actual moderator ID from auth
|
||||
return this.commentsService.approveComment(id, 'admin');
|
||||
}
|
||||
|
||||
@Patch(':id/reject')
|
||||
async rejectComment(@Param('id') id: string) {
|
||||
// TODO: Get actual moderator ID from auth
|
||||
return this.commentsService.rejectComment(id, 'admin');
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async deleteComment(@Param('id') id: string) {
|
||||
return this.commentsService.deleteComment(id);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue