first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { Article, categories } from '@/m_res/Article'
import { res } from '@/utils/jsonResult';
import {CommentParams } from "@/model/request/Comment";
import { Token } from '@/m_req/Token'
import { form } from '@/m_req/Comment'
export interface ArticleService {
GetArticleList(text: string): Promise<res<Array<Article>>>;
GetArticleInfo(id: number): Promise<res<null>>;
GetCategoriesList(): Promise<res<categories[]>>;
GetCategoriesInfo(id: number): Promise<res<Article[]>>;
GetSearch(word: string): Promise<res<Article[]>>
pushComment(params: CommentParams, token: Token): Promise<res<string>>
form(params: form): Promise<res<null>>;//表单的数据接口
}

View File

@@ -0,0 +1,7 @@
import { Link } from '@/entity/Link'
import { res } from '@/utils/jsonResult';
export interface LinkService {
GetAllLink(): Promise<res<Array<Link>>>;
}

View File

@@ -0,0 +1,7 @@
import { Menu } from '@/entity/Menu'
import { res } from '@/utils/jsonResult';
export interface MenuService {
GetAllMenu(): Promise<res<Array<Menu>>>;
}

View File

@@ -0,0 +1,61 @@
import { ArticleService } from '@/service/ArticleService'
import { ArticleDao } from '@/dao/ArticleDao'
import { Service, Inject } from 'typedi';
import { res } from '@/utils/jsonResult';
import { Article, categories, tag } from '@/m_res/Article'
import { CommentParams, form } from '@/model/request/Comment';
import { Token } from '@/m_req/Token'
@Service()
export class ArticleServiceImpl implements ArticleService {
form(params: form): Promise<res<null>> {
throw new Error('Method not implemented.');
}
@Inject()
articleDao!: ArticleDao
async pushComment(params: CommentParams, token: Token): Promise<res<string>> {
return await this.articleDao.pushCommentDao(params, token);
}
// async GetForm(): Promise<res<Menu[]>> {
// return this.ArticleDao.GetForm();
// }
async FormDao(params: form): Promise<res<null>> {
return await this.articleDao.FormDao(params);
}
async GetArticleList(text: string): Promise<res<Array<Article>>> {
return await this.articleDao.GetArticleDao(text);
}
async GetArticleInfo(id: number): Promise<res<null>> {
return await this.articleDao.GetArticleInfoDao(id);
}
async GetCategoriesList(): Promise<res<categories[]>>{
return await this.articleDao.GetCategoriesListDao();
}
async GetTagListDao(): Promise<res<tag[]>>{
return await this.articleDao.GetTagListDao();
}
async GetCategoriesInfo(id: number): Promise<res<Article[]>>{
return await this.articleDao.GetCategoriesInfoDao(id);
}
async GetSearch(word: string): Promise<res<Article[]>> {
return await this.articleDao.SearchDao(word);
}
}

View File

@@ -0,0 +1,17 @@
import { Service, Inject } from 'typedi';
import { res } from '@/utils/jsonResult';
import { LinkService } from '../LinkService';
import { Link } from '@/entity/Link';
import { LinkDao } from '@/dao/LinkDao';
@Service()
export class LinkServiceImpl implements LinkService {
@Inject()
linkDao!: LinkDao
async GetAllLink(): Promise<res<Link[]>> {
return this.linkDao.GetAllLink();
}
}

View File

@@ -0,0 +1,28 @@
import { Service, Inject } from 'typedi';
import { res } from '@/utils/jsonResult';
import { MenuService } from '../MenuService';
import { Menu } from '@/entity/Menu';
import { MenuDao } from '@/dao/MenuDao';
import { CommentParams, form, formlist} from '@/model/request/Comment';
@Service()
export class MenuServiceImpl implements MenuService {
[x: string]: any;
@Inject()
menuDao!: MenuDao
async GetAllMenu(): Promise<res<Menu[]>> {
return this.menuDao.GetAllMenuDao();
}
async GetForm(params:formlist): Promise<res<null>>{
return this.menuDao.Push(params)
}
}

View File

@@ -0,0 +1,31 @@
import { User } from '@/m_res/user'
import { UserService } from '@/service/userService'
import { UserDao } from '@/dao/UserDao'
import { Service, Inject } from 'typedi';
import { addUser } from '@/model/request/User';
import { res } from '@/utils/jsonResult';
import { User as UserType } from '@/m_res/user'
@Service()
export class UserServiceImpl implements UserService {
@Inject()
userDao!: UserDao
GetAlluser(): User[] {
throw new Error('Method not implemented.');
}
async GetOneUser(id: number): Promise<res<UserType | null>> {
return await this.userDao.GetOneUser(id);
}
async addUser(params: addUser): Promise<res<null>> {
return await this.userDao.addUserDao(params);
}
async Login(params: addUser): Promise<res<UserType | null>> {
return await this.userDao.LoginDao(params);
}
}

View File

@@ -0,0 +1,11 @@
import { User } from '@/m_res/user'
import { addUser } from '@/m_req/User'
import { res } from '@/utils/jsonResult';
import { User as UserType } from '@/m_res/user'
export interface UserService {
GetAlluser(): Array<User>;
GetOneUser(id: number): Promise<res<UserType | null>>;
addUser(params: addUser): Promise<res<null>>;
Login(params: addUser): Promise<res<UserType | null>>;
}