first commit

This commit is contained in:
编码猿
2024-09-27 01:28:38 +08:00
commit a9bde91e8e
2653 changed files with 701970 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
/*
* Copyright (c) 2024. bmy
* Email2271608011@qq.com
* Githubhttps://github.com/helpcode
*/
module.exports = {
pageConfig: (name) => {
return `
import "@pageLess/${ name }.less";
import { Component, Vue } from 'vue-property-decorator';
import { ${ name }Logic } from "@logic/page/${ name }.logic";
import { Route, RawLocation } from 'vue-router';
import { VueCustomize, RouterMeta } from "@logic/base.type";
import { Autowired } from "@ann/ioc.annotation";
@Component
export default class ${ name } extends VueCustomize {
private logic: ${name}Logic<${name}> = new ${name}Logic(this);
private RouterMeta: RouterMeta = {
title: '${ name }',
showNav: true,
isLogin: true
};
public async created() {
await this.logic.StartUp();
};
// 路由拦截器
beforeRouteEnter(to: Route, from: Route, next: (to?: RawLocation | false | ((vm: Vue) => void)) => void) {
next();
}
protected render() {
return (
<div class="${ name }">
${ name }
</div>
)
}
}
`
},
logicConfig: (name) => {
return `
import { Autowired } from "@ann/ioc.annotation";
import { UserServiceImpl, ResponseType } from "@impl/user.service.impl";
import { BaseLogic } from "@logic/base.logic";
import { Methods, VueCustomize } from "@logic/base.type";
export class ${name}Logic<T extends ${name}> extends BaseLogic<T> implements Methods {
@Autowired()
public readonly UserServiceImpl!: UserServiceImpl;
constructor(_: T) {
super();
this._ = _;
}
public async StartUp(): Promise<void> {
}
}
`
},
serviceConfig: (name) => {
return `
export interface ${ name }Service {
IndexClass(params: object): Promise<any>;
}
`
},
implPathConfig: (name) => {
return `
import { ${ name }Service } from "@service/${ name }.service";
import { Autowired } from "@ann/Ioc.annotation";
import { GET } from "@ann/Http.annotation";
export class ${ name }ServiceImpl implements ${ name }Service {
@GET({ useHandle: false })
public async IndexClass(params: object): Promise<any> { }
}
`
},
lessConfig: (name) => {
return `
@import "../mixin/_";
.${ name } {
}
`
}
}