├── .DS_Store ├── GoGoGo.WebApp ├── ClientApp │ ├── .browserslistrc │ ├── babel.config.js │ ├── src │ │ ├── views │ │ │ ├── home │ │ │ │ ├── empty.vue │ │ │ │ └── index.vue │ │ │ ├── layout │ │ │ │ ├── menu.vue │ │ │ │ ├── index.vue │ │ │ │ └── top.vue │ │ │ └── login │ │ │ │ └── index.vue │ │ ├── components │ │ │ └── count-to │ │ │ │ ├── index.js │ │ │ │ ├── index.css │ │ │ │ ├── index.less │ │ │ │ └── count-to.vue │ │ ├── config │ │ │ └── menu.js │ │ ├── App.vue │ │ ├── main.js │ │ ├── router │ │ │ ├── config.js │ │ │ └── index.js │ │ ├── libs │ │ │ ├── index.js │ │ │ └── http.js │ │ ├── api │ │ │ └── login.js │ │ ├── assets │ │ │ ├── images │ │ │ │ └── login-bg.svg │ │ │ └── css │ │ │ │ ├── app.css │ │ │ │ └── app.less │ │ └── store │ │ │ └── index.js │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── .editorconfig │ ├── vue.config.js │ ├── .gitignore │ ├── .eslintrc.js │ ├── README.md │ └── package.json ├── appsettings.json ├── appsettings.Development.json ├── Program.cs ├── GoGoGo.WebApp.csproj ├── Properties │ └── launchSettings.json ├── Controllers │ └── ValuesController.cs └── Startup.cs ├── Sql ├── .DS_Store ├── get_data_pager.sql └── GoGoGo.db.sql ├── UnitTest ├── .DS_Store └── GoGoGo.DataStorage.UnitTest │ ├── GoGoGo.DataStorage.UnitTest.csproj │ └── StorageTest.cs ├── DotNetCoreConfiguration ├── appsettings.json ├── DotNetCoreConfiguration.csproj ├── AppSettings.cs ├── MySqlNode.cs ├── MySqlClusterSettings.cs └── ConfigurationManager.cs ├── Gogogo.IF ├── GoGoGo.Abstract.csproj ├── UserRoles.cs ├── Entity │ ├── IIssues.cs │ ├── IUserGroup.cs │ ├── IRoadMap.cs │ ├── IProductVersion.cs │ ├── IProductFeature.cs │ ├── IProductModule.cs │ ├── IUseCase.cs │ ├── IProduct.cs │ ├── IWorkUnit.cs │ ├── IAgileProject.cs │ ├── IDiscussion.cs │ ├── ITestRecord.cs │ ├── IUser.cs │ └── IWorkTask.cs ├── IWorkUnitManager.cs ├── IWorkTaskManager.cs ├── IProductManager.cs ├── IAgileProjectManager.cs ├── UserRights.cs ├── IUserManager.cs └── Flags.cs ├── LogManCore ├── LogManCore.csproj ├── LogLevel.cs └── LogAttribute.cs ├── GoGoGo.Entity ├── GoGoGo.Entity.csproj ├── UserGroup.cs ├── RoadMap.cs ├── ProductVersion.cs ├── Issues.cs ├── ProductFeature.cs ├── ProductModule.cs ├── UseCase.cs ├── Product.cs ├── WorkUnit.cs ├── AglieProject.cs ├── Discussion.cs ├── TestRecord.cs ├── User.cs └── WorkTask.cs ├── .editorconfig ├── GoGoGo.Core ├── ProductManager.cs ├── GoGoGo.Core.csproj └── UserManager.cs ├── README.md ├── GoGoGo.DataStorage ├── GoGoGo.DataStorage.csproj ├── IssuesRepo.cs ├── UserGroupRepo.cs ├── ProductRepo.cs ├── UseCaseRepo.cs ├── DiscussionRepo.cs ├── TestRecordRepo.cs ├── ProductFeatureRepo.cs ├── ProductModuleRepo.cs ├── ProductVersionRepo.cs ├── WorkUnitRepo.cs ├── UserRepo.cs ├── WorkTaskRepo.cs ├── RoadMapRepo.cs ├── AglieProjectRepo.cs └── DataRepoBase.cs ├── GoGoGo.sln └── .gitignore /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfjiang/GoGoGo/HEAD/.DS_Store -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /Sql/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfjiang/GoGoGo/HEAD/Sql/.DS_Store -------------------------------------------------------------------------------- /UnitTest/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfjiang/GoGoGo/HEAD/UnitTest/.DS_Store -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/app"] 3 | }; 4 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/home/empty.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/components/count-to/index.js: -------------------------------------------------------------------------------- 1 | import countTo from "./count-to.vue"; 2 | export default countTo; 3 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfjiang/GoGoGo/HEAD/DotNetCoreConfiguration/appsettings.json -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfjiang/GoGoGo/HEAD/GoGoGo.WebApp/ClientApp/public/favicon.ico -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/config/menu.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: "home", 4 | title: "首页" 5 | } 6 | ]; 7 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | charset = utf-8 7 | trim_trailing_whitespace = false 8 | insert_final_newline = false -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | lintOnSave: false, 3 | productionSourceMap: false, 4 | devServer: { 5 | proxy: "http://localhost:32734/" 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/components/count-to/index.css: -------------------------------------------------------------------------------- 1 | .count-to-wrapper .content-outer { 2 | display: inline-block; 3 | } 4 | .count-to-wrapper .content-outer .count-to-unit-text { 5 | font-style: normal; 6 | } 7 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/components/count-to/index.less: -------------------------------------------------------------------------------- 1 | @prefix: ~"count-to"; 2 | 3 | .@{prefix}-wrapper { 4 | .content-outer { 5 | display: inline-block; 6 | 7 | .@{prefix}-unit-text { 8 | font-style: normal; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Gogogo.IF/GoGoGo.Abstract.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /LogManCore/LogManCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /GoGoGo.Entity/GoGoGo.Entity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | Gogogo.Entity 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/home/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ["plugin:vue/essential", "@vue/prettier"], 7 | rules: { 8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off", 9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" 10 | }, 11 | parserOptions: { 12 | parser: "babel-eslint" 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | import router from "./router"; 4 | import store from "./store"; 5 | 6 | import ElementUI from "element-ui"; 7 | import "element-ui/lib/theme-chalk/index.css"; 8 | 9 | Vue.use(ElementUI); 10 | 11 | import "@/assets/css/app.less"; 12 | 13 | Vue.config.productionTip = false; 14 | 15 | new Vue({ 16 | router, 17 | store, 18 | render: h => h(App) 19 | }).$mount("#app"); 20 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = crlf 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.{cs,vb}] 13 | indent_style = tab 14 | indent_size = 4 15 | 16 | [*.xml] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.json] 21 | indent_style = space 22 | indent_size = 4 -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/README.md: -------------------------------------------------------------------------------- 1 | # admin-ui 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | npm run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | npm run lint 26 | ``` 27 | 28 | ### Customize configuration 29 | See [Configuration Reference](https://cli.vuejs.org/config/). 30 | -------------------------------------------------------------------------------- /GoGoGo.Core/ProductManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GoGoGo.DataStorage; 3 | 4 | namespace GoGoGo.Core 5 | { 6 | public class ProductManager 7 | { 8 | #region private fileds 9 | private ProductRepo m_ProductRepo; 10 | private string m_ConnStr; 11 | #endregion 12 | 13 | public ProductManager(string connstr) 14 | { 15 | if (String.IsNullOrEmpty(connstr)) 16 | { 17 | throw new ArgumentNullException("connstr"); 18 | } 19 | 20 | m_ConnStr = connstr; 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Gogogo.IF/UserRoles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract 6 | { 7 | public enum UserRoles : int 8 | { 9 | SystemAdmin = 90, 10 | TeamLeader = 91, 11 | ProjectManager = 92, 12 | ProductDesigner = 93, 13 | TestingManager =94, 14 | UEDesigner = 94, 15 | UIDesigner = 95, 16 | Tester = 96, 17 | Developer = 97, 18 | ArchitectureDesigner =98, 19 | Publisher = 99 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IIssues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | public interface IIssues 8 | { 9 | ulong id { get; set; } 10 | ulong product_id { get; set; } 11 | ulong creator_id { get; set; } 12 | ulong last_editor_id { get; set; } 13 | string from_whom { get; set; } 14 | string title { get; set; } 15 | string remark { get; set; } 16 | int level { get; set; } 17 | int state { get; set; } 18 | DateTime created { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /GoGoGo.Core/GoGoGo.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoGoGo 2 | 3 | GoGoGo是一款敏捷项目管理软件/工具集 4 | 5 | ## 主要设计目标: 6 | 1. 内建账号登录 7 | 2. 产品库 8 | 3. 项目库 9 | 4. 任务板 10 | 5. 微信登录 11 | 6. 任务上下文图文消息 12 | 7. 任务赏金系统 13 | 8. 源码版本管理集成 14 | 9. 测试平台集成 15 | 10. VS任务插件集成 16 | 11. AI辅助功能 17 | 18 | 19 | GoGoGo is an agile project management software/tools 20 | 21 | ## Main design goals: 22 | 1. built-in account login 23 | 2. product library 24 | 3. project library 25 | 4. task board 26 | 5. WeChat login 27 | 6. task context message 28 | 7. task bounty system 29 | 8. source version management integration 30 | 9. test platform integration 31 | 10. VS task plugin integration 32 | 11. AI auxiliary function 33 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/DotNetCoreConfiguration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | admin-ui 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Gogogo.IF/IWorkUnitManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Abstract 8 | { 9 | public interface IWorkUnitManager 10 | { 11 | ulong Add(IWorkUnit unit); 12 | bool Update(IWorkUnit unit); 13 | bool Delete(ulong id); 14 | IAgileProject Get(ulong id); 15 | DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields); 16 | List LoadChilds(ulong projectID); 17 | List LoadChilds(ulong projectID,ulong parentUnitID); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace GoGoGo.WebApp 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/GoGoGo.WebApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | InProcess 6 | 7 | 8 | 9 | 10 | all 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Gogogo.IF/IWorkTaskManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Abstract 8 | { 9 | public interface IWorkTaskManager 10 | { 11 | ulong Add(IWorkUnit unit); 12 | bool Update(IWorkUnit unit); 13 | bool Delete(ulong id); 14 | bool MoveToUser(ulong id, ulong userID); 15 | IWorkTask Get(ulong id); 16 | DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields); 17 | List LoadProjectTasks(ulong projectID); 18 | List LoadWorkUnitTasks(ulong projectID, ulong unitID); 19 | List LoadUserTasks(ulong projectID, ulong userID); 20 | List LoadUserTasks(ulong userID); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/GoGoGo.DataStorage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/router/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 路由配置 3 | */ 4 | 5 | export default [ 6 | { 7 | path: "/login", 8 | name: "login", 9 | meta: { 10 | hideInMenu: true 11 | }, 12 | component: () => import("@/views/login/index.vue") 13 | }, 14 | 15 | { 16 | path: "/", 17 | name: "main", 18 | redirect: "/home", 19 | meta: { 20 | hideInMenu: true 21 | }, 22 | component: () => import("@/views/layout/index.vue"), 23 | children: [ 24 | { 25 | path: "/home", 26 | name: "home", 27 | meta: { 28 | title: "首页" 29 | }, 30 | component: () => import("@/views/home/index.vue") 31 | } 32 | ] 33 | } 34 | ]; 35 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:32734", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "GoGoGo.WebApp": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/values", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | }, 27 | "applicationUrl": "http://localhost:5000" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Gogogo.IF/IProductManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using GoGoGo.Abstract.Entity; 5 | 6 | namespace GoGoGo.Abstract 7 | { 8 | public interface IProductManager 9 | { 10 | 11 | ulong AddProduct(IProduct product); 12 | ulong AddModule(IProductModule module); 13 | ulong AddFeature(IProductFeature feature); 14 | 15 | bool Update(IProduct product); 16 | bool UpdateModule(IProductModule module); 17 | bool UpdateFeature(IProductFeature feature); 18 | 19 | bool DeleteProduct(ulong id); 20 | bool DeleteModule(ulong id); 21 | bool DeleteFeature(ulong id); 22 | 23 | IProduct Get(ulong id); 24 | 25 | List FindByName(string name); 26 | List FindByName(string name,int productType); 27 | List FindByType(int productType); 28 | 29 | DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/libs/index.js: -------------------------------------------------------------------------------- 1 | import Cookie from "js-cookie"; 2 | 3 | /** 4 | * TODO 5 | */ 6 | export const resolveMenuFromRoutes = routes => { 7 | function getMenus(route, result) { 8 | var menu = { 9 | name: route.name, 10 | title: route.meta && route.meta.title, 11 | children: [] 12 | }; 13 | 14 | if (route.children) { 15 | route.children 16 | .filter(item => item.meta && !item.meta["hideInMenu"]) 17 | .forEach(item => { 18 | getMenus(item, menu.children); 19 | }); 20 | } 21 | 22 | result.push(menu); 23 | } 24 | 25 | var result = []; 26 | routes 27 | .filter(item => item.meta && !item.meta["hideInMenu"]) 28 | .forEach(item => { 29 | getMenus(item, result); 30 | }); 31 | 32 | return result; 33 | }; 34 | 35 | export const getToken = () => { 36 | return Cookie.get(".token") || ""; 37 | }; 38 | 39 | export const setToken = token => { 40 | Cookie.set(".token", token); 41 | }; 42 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace GoGoGo.WebApp.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | [ApiController] 11 | public class ValuesController : ControllerBase 12 | { 13 | // GET api/values 14 | [HttpGet] 15 | public ActionResult> Get() 16 | { 17 | return new string[] { "value1", "value2" }; 18 | } 19 | 20 | // GET api/values/5 21 | [HttpGet("{id}")] 22 | public ActionResult Get(int id) 23 | { 24 | return "value"; 25 | } 26 | 27 | // POST api/values 28 | [HttpPost] 29 | public void Post([FromBody] string value) 30 | { 31 | } 32 | 33 | // PUT api/values/5 34 | [HttpPut("{id}")] 35 | public void Put(int id, [FromBody] string value) 36 | { 37 | } 38 | 39 | // DELETE api/values/5 40 | [HttpDelete("{id}")] 41 | public void Delete(int id) 42 | { 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Router from "vue-router"; 3 | import routes from "./config"; 4 | import store from "../store"; 5 | 6 | import { getToken, setToken } from "@/libs/"; 7 | import { getUserInfo } from "@/api/login"; 8 | 9 | Vue.use(Router); 10 | 11 | const router = new Router({ 12 | // mode: "history", 13 | routes: routes 14 | }); 15 | 16 | router.beforeEach((to, from, next) => { 17 | next(); 18 | 19 | // var token = getToken(); 20 | // if (!token && to.name !== "login") { 21 | // next({ name: "login" }); 22 | // } else if (!token && to.name === "login") { 23 | // next(); 24 | // } else if (token && to.name === "login") { 25 | // next({ name: "home" }); 26 | // } else { 27 | // if (store.state.hasUserInfo) next(); 28 | // else { 29 | // getUserInfo() 30 | // .then(result => { 31 | // next(); 32 | // }) 33 | // .catch(err => { 34 | // setToken(""); 35 | // next({ name: "login" }); 36 | // }); 37 | // } 38 | // } 39 | }); 40 | 41 | export default router; 42 | -------------------------------------------------------------------------------- /Gogogo.IF/IAgileProjectManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Abstract 8 | { 9 | public interface IAgileProjectManager 10 | { 11 | ulong Add(IAgileProject project); 12 | bool Update(IAgileProject project); 13 | bool Delete(ulong id); 14 | IAgileProject Get(ulong id); 15 | DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields); 16 | ulong AddWorkUnit(ulong projectID, ulong? parentUnitID); 17 | bool RemoveWorkUnit(ulong projectID, ulong unitID); 18 | bool MoveWorkUnit(ulong projectID, ulong fromUnitID,ulong toUnitID); 19 | List FindByCreator(ulong creatorID); 20 | List FindByChifeManager(ulong chifeManagerID); 21 | List FindByExecutor(ulong executorID); 22 | double GetProgress(ulong projectID); 23 | int CountTask(ulong projectID); 24 | int CountTask(ulong projectID, ulong workUnitID); 25 | List GetMembers(ulong projectID); 26 | List GetMembers(ulong projectID, ulong workUnitID); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UnitTest/GoGoGo.DataStorage.UnitTest/GoGoGo.DataStorage.UnitTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Gogogo.IF/UserRights.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract 6 | { 7 | public enum UserRights : int 8 | { 9 | SystemEdit = 100,//CRUD 10 | SystemBrowse =101,//LIST,READ 11 | 12 | ProjectEdit = 200,//CRUD 13 | ProjectBrowse = 201,//LIST,READ 14 | ProjectApproval = 202,//DENY,ACCESS 15 | 16 | WorkUnitEdit = 300,//CRUD 17 | WorkUnitBrowse = 301,//LIST,READ 18 | WorkUnitApproval =302,//DENY,ACCESS 19 | 20 | ProductEdit = 400,//CRUD 21 | ProductBrowse = 401,//LIST,READ 22 | ProdcutApproval = 402,//DENY,ACCESS 23 | 24 | TaskEdit = 500,//CRUD 25 | TaskBrowse = 501,//LIST,READ 26 | TaskApproval = 502,//DENY,ACCESS 27 | 28 | IssuesEdit = 600,//CRUD 29 | IssuesBrowse = 601,//LIST,READ 30 | IssuesApproval = 602,//DENY,ACCESS 31 | 32 | TestEdit = 700,//CRUD 33 | TestBrowse = 701,//LIST,READ 34 | TestApproval = 702,//DENY,ACCESS 35 | 36 | UserEdit = 800,//CRUD 37 | UserBrowse = 801,//LIST,READ 38 | UserApproval = 802,//DENY,ACCESS 39 | 40 | SupperRights = 10000 //ROOT 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin-ui", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@aspnet/signalr": "^1.1.4", 12 | "axios": "0.19.0", 13 | "core-js": "^2.6.5", 14 | "countup": "1.8.2", 15 | "element-ui": "^2.11.1", 16 | "js-cookie": "2.2.0", 17 | "moment": "2.24.0", 18 | "qs": "6.7.0", 19 | "vue": "^2.6.10", 20 | "vue-router": "^3.0.7", 21 | "vuex": "^3.1.1", 22 | "echarts": "^4.2.1" 23 | }, 24 | "devDependencies": { 25 | "@vue/cli-plugin-babel": "^3.10.0", 26 | "@vue/cli-plugin-eslint": "^3.10.0", 27 | "@vue/cli-service": "^3.10.0", 28 | "@vue/eslint-config-prettier": "^5.0.0", 29 | "babel-eslint": "^10.0.1", 30 | "eslint": "^5.16.0", 31 | "eslint-plugin-prettier": "^3.1.0", 32 | "eslint-plugin-vue": "^5.0.0", 33 | "prettier": "^1.18.2", 34 | "vue-template-compiler": "^2.6.10", 35 | "less": "^3.9.0", 36 | "less-loader": "^5.0.0" 37 | } 38 | } -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/libs/http.js: -------------------------------------------------------------------------------- 1 | import Axios from "axios"; 2 | import qs from "qs"; 3 | import { getToken } from "./index"; 4 | 5 | // Axios.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8"; 6 | //axios.defaults.headers["Authorization"] = getAccessToken(); 7 | Axios.defaults.timeout = 30000; // 30s 8 | Axios.defaults.withCredentials = true; 9 | 10 | /** 11 | * 12 | */ 13 | class HttpClient { 14 | constructor() {} 15 | 16 | config() { 17 | return { 18 | baseURL: "/", 19 | headers: { 20 | // 21 | Authorization: "Bearer " + getToken() 22 | } 23 | }; 24 | } 25 | 26 | interceptors(instance, options) {} 27 | 28 | create(options) { 29 | var instance = Axios.create(); 30 | options = Object.assign(this.config(), options); 31 | 32 | this.interceptors(instance, options); 33 | return instance(options); 34 | } 35 | } 36 | 37 | const http = new HttpClient(); 38 | 39 | const get = (url, params) => { 40 | return http.create({ 41 | url: url, 42 | params 43 | }); 44 | }; 45 | 46 | const post = (url, data) => { 47 | return http.create({ 48 | method: "post", 49 | url: url, 50 | data: data 51 | }); 52 | }; 53 | 54 | export default { 55 | get, 56 | post 57 | }; 58 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/api/login.js: -------------------------------------------------------------------------------- 1 | import http from "../libs/http"; 2 | import store from "../store"; 3 | 4 | export const loginSubmit = payload => { 5 | return new Promise(function(resolve, reject) { 6 | http.post("api/auth/token", payload) 7 | .then(result => { 8 | if (result.data) { 9 | // console.log(result.data); 10 | store.dispatch("saveAccessToken", { token: result.data.token }); 11 | store.dispatch("updateUserInfo", { data: result.data }); 12 | resolve(); 13 | } else { 14 | reject(); 15 | } 16 | }) 17 | .catch(err => { 18 | console.log(err); 19 | reject(); 20 | }); 21 | }); 22 | }; 23 | 24 | export const getUserInfo = () => { 25 | return new Promise(function(resolve, reject) { 26 | http.get("api/auth/identity") 27 | .then(result => { 28 | if (result.data) { 29 | store.dispatch("updateUserInfo", { data: result.data }); 30 | resolve(result.data); 31 | } else { 32 | reject(); 33 | } 34 | }) 35 | .catch(err => { 36 | console.log(err); 37 | reject(); 38 | }); 39 | }); 40 | }; 41 | -------------------------------------------------------------------------------- /Sql/get_data_pager.sql: -------------------------------------------------------------------------------- 1 | -- ---------------------------- 2 | -- Procedure structure for get_data_pager 3 | -- ---------------------------- 4 | DROP PROCEDURE IF EXISTS `get_data_pager`; 5 | DELIMITER ;; 6 | CREATE DEFINER=`app_user`@`%` PROCEDURE `get_data_pager`( 7 | IN p_table_name VARCHAR(6000), 8 | IN p_fields VARCHAR(6000), 9 | IN p_page_size INT, 10 | IN p_page_now INT, 11 | IN p_order_string VARCHAR(512), 12 | IN p_where_string VARCHAR(3000) 13 | ) 14 | SQL SECURITY INVOKER 15 | COMMENT '分页存储过程' 16 | BEGIN 17 | 18 | 19 | DECLARE m_begin_row INT DEFAULT 0; 20 | DECLARE m_limit_string CHAR(64); 21 | 22 | 23 | SET m_begin_row = (p_page_now - 1) * p_page_size; 24 | SET m_limit_string = CONCAT(' LIMIT ', m_begin_row, ', ', p_page_size); 25 | 26 | SET @COUNT_STRING = CONCAT('SELECT COUNT(*) FROM ', p_table_name, ' ', p_where_string); 27 | SET @MAIN_STRING = CONCAT('SELECT ', p_fields, ' FROM ', p_table_name, ' ', p_where_string, ' ', p_order_string, m_limit_string); 28 | 29 | 30 | PREPARE count_stmt FROM @COUNT_STRING; 31 | EXECUTE count_stmt; 32 | DEALLOCATE PREPARE count_stmt; 33 | 34 | PREPARE main_stmt FROM @MAIN_STRING; 35 | EXECUTE main_stmt; 36 | DEALLOCATE PREPARE main_stmt; 37 | 38 | END 39 | ;; 40 | DELIMITER ; -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/layout/menu.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 56 | 57 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/assets/images/login-bg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bg 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IUserGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public interface IUserGroup 28 | { 29 | string group_name { get; set; } 30 | string users { get; set; }//id1,id2,id3,... 31 | ulong creator_id { get; set; } 32 | DateTime created { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IRoadMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IRoadMap 27 | { 28 | ulong id { get; set; } 29 | ulong project_id { get; set; } 30 | DateTime deadline { get; set; } 31 | string title { get; set; } 32 | string remark { get; set; } 33 | int state { get; set; } 34 | DateTime? finish_date { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IProductVersion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IProductVersion 27 | { 28 | ulong id { get; set; } 29 | string version_code { get; set; } 30 | ulong product_id { get; set; } 31 | ulong creator_id { get; set; } 32 | string remark { get; set; } 33 | int level { get; set; } 34 | int state { get; set; } 35 | DateTime created { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/IssuesRepo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Linq; 4 | using System.Data; 5 | using MySql.Data.MySqlClient; 6 | using Dapper; 7 | using Dapper.Contrib; 8 | using Dapper.Contrib.Extensions; 9 | using GoGoGo.Abstract.Entity; 10 | 11 | namespace GoGoGo.DataStorage 12 | { 13 | /* 14 | Copyright (C) 2019 Jiang Ming Feng 15 | Github: https://github.com/mfjiang 16 | Contact: hamlet.jiang@live.com 17 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 18 | 19 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 20 | 21 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 22 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 23 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 | 25 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 26 | 27 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 28 | 29 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 30 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 | */ 32 | 33 | public class IssuesRepo:DataRepoBase 34 | { 35 | public IssuesRepo(string connStr):base(connStr) 36 | { 37 | 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/assets/css/app.css: -------------------------------------------------------------------------------- 1 | .clearfix:before, 2 | .clearfix:after { 3 | content: "\0020"; 4 | display: block; 5 | height: 0; 6 | visibility: hidden; 7 | } 8 | .clearfix { 9 | zoom: 1; 10 | } 11 | .clearfix:after { 12 | clear: both; 13 | } 14 | * html .clearfix { 15 | zoom: 1; 16 | } 17 | *:first-child + html .clearfix { 18 | zoom: 1; 19 | } 20 | .hidden { 21 | border: 0 !important; 22 | clip: rect(1px 1px 1px 1px); 23 | clip: rect(1px, 1px, 1px, 1px); 24 | height: 1px !important; 25 | margin: -1px; 26 | overflow: hidden; 27 | padding: 0 !important; 28 | position: absolute !important; 29 | width: 1px; 30 | } 31 | .display-block { 32 | display: block; 33 | } 34 | .display-none, 35 | .display-hide { 36 | display: none; 37 | } 38 | .inline { 39 | display: inline; 40 | } 41 | .text-right { 42 | text-align: right !important; 43 | } 44 | .text-left { 45 | text-align: left !important; 46 | } 47 | .text-center { 48 | text-align: center !important; 49 | } 50 | .pull-left { 51 | float: left !important; 52 | } 53 | .pull-right { 54 | float: right !important; 55 | } 56 | /****/ 57 | pre { 58 | font-size: 12px; 59 | padding: 16px; 60 | background-color: #004578; 61 | color: #fff; 62 | text-overflow: clip; 63 | word-break: break-all; 64 | word-wrap: break-word; 65 | border: 1px solid #d3d3d3; 66 | border-radius: 3px; 67 | white-space: pre-wrap; 68 | font-size: 14px; 69 | display: block; 70 | } 71 | /*****/ 72 | .search-bar { 73 | margin-bottom: 15px; 74 | } 75 | .search-bar .searbar-button { 76 | text-align: center; 77 | } 78 | .table-toolbar { 79 | margin-bottom: 10px; 80 | } 81 | .table-toolbar .el-button-group + .el-button-group { 82 | margin-left: 10px; 83 | } 84 | .table-footer { 85 | margin-top: 10px; 86 | } 87 | .btn-block { 88 | width: 100%; 89 | display: block; 90 | } 91 | -------------------------------------------------------------------------------- /Gogogo.IF/IUserManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Abstract 8 | { 9 | public interface IUserManager 10 | { 11 | #region about user 12 | 13 | ulong AddUser(IUser user); 14 | bool Update(IUser user); 15 | bool DeleteUser(ulong id); 16 | IUser Get(ulong id); 17 | 18 | /// 19 | /// limits in 100 20 | /// 21 | /// 22 | /// 23 | List FindByNickName(string name); 24 | /// 25 | /// limits in 100 26 | /// 27 | /// 28 | /// 29 | List FindByRealName(string name); 30 | /// 31 | /// limits in 100 32 | /// 33 | /// 34 | /// 35 | List FindByMoblie(string mobile); 36 | /// 37 | /// limits in 100 38 | /// 39 | /// 40 | /// 41 | List FindByEmail(string email); 42 | 43 | DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields); 44 | #endregion 45 | 46 | #region about user group 47 | IUserGroup AddGroup(string groupName, ulong cratorId, params ulong[] userIds); 48 | bool RemoveGroup(string groupName); 49 | void MoveInGroup(string groupName, ulong userId); 50 | void MoveOutGroup(string groupName, ulong userId); 51 | IUserGroup GetGroup(string groupName); 52 | List FindGroups(string groupName); 53 | #endregion 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/UserGroupRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class UserGroupRepo : DataRepoBase 35 | { 36 | public UserGroupRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/ProductRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class ProductRepo : DataRepoBase 35 | { 36 | public ProductRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/UseCaseRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class UseCaseRepo : DataRepoBase 35 | { 36 | public UseCaseRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/DiscussionRepo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using MySql.Data.MySqlClient; 4 | using System.Linq; 5 | using Dapper; 6 | using Dapper.Contrib; 7 | using Dapper.Contrib.Extensions; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.Data.SqlClient; 11 | using GoGoGo.Abstract.Entity; 12 | 13 | namespace GoGoGo.DataStorage 14 | { 15 | /* 16 | Copyright (C) 2019 Jiang Ming Feng 17 | Github: https://github.com/mfjiang 18 | Contact: hamlet.jiang@live.com 19 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 20 | 21 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 22 | 23 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 24 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 25 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 | 27 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 28 | 29 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 30 | 31 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 32 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | */ 34 | 35 | public class DiscussionRepo : DataRepoBase 36 | { 37 | public DiscussionRepo(string connStr) : base(connStr) 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/TestRecordRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class TestRecordRepo : DataRepoBase 35 | { 36 | public TestRecordRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/ProductFeatureRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class ProductFeatureRepo : DataRepoBase 35 | { 36 | public ProductFeatureRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/ProductModuleRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class ProductModuleRepo : DataRepoBase 35 | { 36 | public ProductModuleRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/ProductVersionRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class ProductVersionRepo : DataRepoBase 35 | { 36 | public ProductVersionRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IProductFeature.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IProductFeature 27 | { 28 | ulong id { get; set; } 29 | ulong product_id { get; set; } 30 | ulong module_id { get; set; } 31 | ulong creator_id { get; set; } 32 | ulong last_editor_id { get; set; } 33 | string title { get; set; } 34 | string remark { get; set; } 35 | int level { get; set; } 36 | int state { get; set; } 37 | DateTime created { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /GoGoGo.Entity/UserGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("user_group")] 31 | public class UserGroup:IUserGroup 32 | { 33 | [Key] 34 | public string group_name { get; set; } 35 | public string users { get; set; }//id1,id2,id3,... 36 | public ulong creator_id { get; set; } 37 | public DateTime created { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /UnitTest/GoGoGo.DataStorage.UnitTest/StorageTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System; 3 | using System.Text; 4 | using System.Linq; 5 | using MySql.Data; 6 | using MySql.Data.MySqlClient; 7 | using Dapper; 8 | using GoGoGo.Core; 9 | using GoGoGo.Abstract; 10 | using GoGoGo.Abstract.Entity; 11 | using GoGoGo.Entity; 12 | 13 | namespace GoGoGo.DataStorage.UnitTest 14 | { 15 | [TestClass] 16 | public class StoreageTest 17 | { 18 | private string connstr = "server=localhost;database=GoGoGo;user=app_user;password=Today!IsAnNiceDay*666;charset=utf8;"; 19 | 20 | [TestMethod] 21 | public void TestUserManager() 22 | { 23 | IUserManager manager = (IUserManager)new UserManager(connstr); 24 | Assert.IsNotNull(manager); 25 | 26 | //IUser user = new User(); 27 | //user.created = DateTime.Now; 28 | //user.email = "admin@gmail.com"; 29 | //user.employee_no = "1000"; 30 | //user.work_groups = "admin"; 31 | //user.is_banned = false; 32 | //user.mobile_no = "13600000000"; 33 | //user.nick_name = "SystemAdmin"; 34 | //user.pwd = "123456"; 35 | //user.real_name = "James"; 36 | //user.roles = "90";//System Admin 37 | //user.title = "Administrator"; 38 | 39 | //ulong id = manager.AddUser(user); 40 | //Assert.IsTrue(id > 0); 41 | 42 | IUser temp = manager.Get(1); 43 | Assert.IsNotNull(temp); 44 | 45 | var ul = manager.FindByRealName(temp.real_name); 46 | Assert.IsTrue(ul.Count > 0); 47 | 48 | var ul2 = manager.FindByNickName(temp.nick_name); 49 | Assert.IsTrue(ul2.Count > 0); 50 | 51 | var ul3 = manager.FindByEmail(temp.email); 52 | Assert.IsTrue(ul3.Count > 0); 53 | 54 | var ul4 = manager.FindByMoblie(temp.mobile_no); 55 | Assert.IsTrue(ul4.Count > 0); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IProductModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public interface IProductModule 28 | { 29 | ulong id { get; set; } 30 | string module_code { get; set; } 31 | ulong creator_id { get; set; } 32 | ulong last_editor_id { get; set; } 33 | ulong version_id { get; set; } 34 | ulong parent_id { get; set; } 35 | ulong product_id { get; set; } 36 | string title { get; set; } 37 | string remark { get; set; } 38 | int level { get; set; } 39 | int state { get; set; } 40 | DateTime created { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IUseCase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IUseCase 27 | { 28 | ulong id { get; set; } 29 | ulong product_id { get; set; } 30 | ulong module_id { get; set; } 31 | ulong creator_id { get; set; } 32 | ulong last_editor_id { get; set; } 33 | string test_path { get; set; } 34 | string remark { get; set; } 35 | string paramas { get; set; } 36 | string expected_results { get; set; } 37 | string tested_results { get; set; } 38 | bool quality_pass { get; set; } 39 | int state { get; set; } 40 | DateTime created { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IProduct.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IProduct 27 | { 28 | ulong id { get; set; } 29 | int product_type { get; set; } 30 | string code { get; set; } 31 | string name { get; set; } 32 | string remark { get; set; } 33 | string main_ver { get; set; } 34 | string source_uri { get; set; } 35 | string open_api_uri { get; set; } 36 | ulong creator_id { get; set; } 37 | ulong last_editor_id { get; set; } 38 | int level { get; set; } 39 | int state { get; set; } 40 | DateTime? last_updated { get; set; } 41 | DateTime created { get; set; } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/AppSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace DotNetCoreConfiguration 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | /// 28 | /// 对应appsettings.json中的AppSettings节 29 | /// 30 | public class AppSettings 31 | { 32 | public AppSettings() { } 33 | 34 | /// 35 | /// 主数据库名称 36 | /// 37 | public string DBName { get; set; } 38 | 39 | /// 40 | /// 日志路径 41 | /// 42 | public string LogManPath { get; set; } 43 | 44 | /// 45 | /// Redis连接串 46 | /// 47 | public string RedisConn { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GoGoGo.Entity/RoadMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | using GoGoGo.Abstract.Entity; 7 | 8 | namespace GoGoGo.Entity 9 | { 10 | /* 11 | Copyright (C) 2019 Jiang Ming Feng 12 | Github: https://github.com/mfjiang 13 | Contact: hamlet.jiang@live.com 14 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 15 | 16 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 17 | 18 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 19 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 23 | 24 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 25 | 26 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 27 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 | */ 29 | 30 | [Serializable] 31 | [Table("roadmap")] 32 | public class RoadMap : IRoadMap 33 | { 34 | [Key] 35 | public ulong id { get; set; } 36 | public ulong project_id { get; set; } 37 | public DateTime deadline { get; set; } 38 | public string title { get; set; } 39 | public string remark { get; set ; } 40 | public int state { get; set; } 41 | public DateTime? finish_date { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/WorkUnitRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class WorkUnitRepo : DataRepoBase 35 | { 36 | public WorkUnitRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | public DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize = 50, int pageNo = 1, string fields = "*") 41 | { 42 | return base.GetDataPage(sqlQuery, orderBy, "work_unit", pageSize, pageNo, fields); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /GoGoGo.Entity/ProductVersion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("product_version")] 31 | public class ProductVersion:IProductVersion 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public string version_code { get; set; } 36 | public ulong product_id { get; set; } 37 | public ulong creator_id { get; set; } 38 | public string remark { get; set; } 39 | public int level { get; set; } 40 | public int state { get; set; } 41 | public DateTime created { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /GoGoGo.Entity/Issues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | [Serializable] 29 | [Table("issues")] 30 | public class Issues : IIssues 31 | { 32 | [Key] 33 | public ulong id { get; set; } 34 | public ulong product_id { get; set; } 35 | public ulong creator_id { get; set; } 36 | public ulong last_editor_id { get; set; } 37 | public string from_whom { get; set; } 38 | public string title { get; set; } 39 | public string remark { get; set; } 40 | public int level { get; set; } 41 | public int state { get; set; } 42 | public DateTime created { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IWorkUnit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public interface IWorkUnit 28 | { 29 | ulong project_id { get; set; } 30 | ulong parent_id { get; set; } 31 | ulong id { get; set; } 32 | ulong product_id { get; set; } 33 | ulong version_id { get; set; } 34 | ulong module_id { get; set; } 35 | ulong creator_id { get; set; } 36 | ulong executor_id { get; set; } 37 | string members { get; set; } 38 | string title { get; set; } 39 | DateTime? start_date { get; set; } 40 | DateTime? finish_date { get; set; } 41 | int level { get; set; } 42 | int state { get; set; } 43 | DateTime created { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/UserRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | 15 | /* 16 | Copyright (C) 2019 Jiang Ming Feng 17 | Github: https://github.com/mfjiang 18 | Contact: hamlet.jiang@live.com 19 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 20 | 21 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 22 | 23 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 24 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 25 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 | 27 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 28 | 29 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 30 | 31 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 32 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | */ 34 | 35 | public class UserRepo : DataRepoBase 36 | { 37 | public UserRepo(string connStr) : base(connStr) 38 | { 39 | 40 | } 41 | 42 | public DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize = 50, int pageNo = 1, string fields = "*") 43 | { 44 | return base.GetDataPage(sqlQuery, orderBy, "user", pageSize, pageNo, fields); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/WorkTaskRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class WorkTaskRepo : DataRepoBase 35 | { 36 | public WorkTaskRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | 41 | public DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize = 50, int pageNo = 1, string fields = "*") 42 | { 43 | return base.GetDataPage(sqlQuery, orderBy, "work_task", pageSize, pageNo, fields); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/RoadMapRepo.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MySql.Data.MySqlClient; 3 | using System.Linq; 4 | using Dapper; 5 | using Dapper.Contrib; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Data.SqlClient; 10 | using GoGoGo.Abstract.Entity; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class RoadMapRepo : DataRepoBase 35 | { 36 | public RoadMapRepo(string connStr) : base(connStr) 37 | { 38 | 39 | } 40 | 41 | public DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize = 50, int pageNo = 1, string fields = "*") 42 | { 43 | return base.GetDataPage(sqlQuery, orderBy, "roadmap", pageSize, pageNo, fields); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Vuex from "vuex"; 3 | 4 | import { getToken, setToken } from "@/libs/"; 5 | 6 | Vue.use(Vuex); 7 | 8 | export default new Vuex.Store({ 9 | state: { 10 | token: getToken(), 11 | hasUserInfo: false, 12 | user: { 13 | name: "" 14 | } 15 | }, 16 | mutations: { 17 | updateUserName(state, value) { 18 | state.user.name = value; 19 | }, 20 | setToken(state, value) { 21 | state.token = value; 22 | setToken(value); 23 | }, 24 | setAccessKeys(state, value) {}, 25 | setHasUserInfo(state, value) { 26 | state.hasUserInfo = value; 27 | } 28 | }, 29 | actions: { 30 | /** 31 | * 保存token 32 | * @param {string} token 33 | */ 34 | saveAccessToken({ commit }, { token }) { 35 | return new Promise((resolve, reject) => { 36 | if (token) { 37 | commit("setToken", token); 38 | commit("setHasUserInfo", false); 39 | resolve(token); 40 | } else { 41 | reject(); 42 | } 43 | }); 44 | }, 45 | 46 | /** 47 | * 清理token 48 | */ 49 | clearToken({ commit }) { 50 | return new Promise(resolve => { 51 | commit("setToken", ""); 52 | commit("setAccessKeys", []); 53 | commit("setHasUserInfo", false); 54 | resolve(); 55 | }); 56 | }, 57 | 58 | /** 59 | * 更新当前用户信息 60 | */ 61 | updateUserInfo({ commit }, { data }) { 62 | return new Promise(resolve => { 63 | commit("updateUserName", data.userName); 64 | // commit("updateUserName", data.displayName); 65 | commit("setAccessKeys", []); 66 | commit("setHasUserInfo", true); 67 | resolve(data); 68 | }); 69 | } 70 | } 71 | }); 72 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IAgileProject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public interface IAgileProject 28 | { 29 | ulong id { get; set; } 30 | string title { get; set; } 31 | ulong creator_id { get; set; } 32 | ulong last_editor_id { get; set; } 33 | ulong chife_manager_id { get; set; } 34 | ulong executor_id { get; set; } 35 | int level { get; set; } 36 | int state { get; set; } 37 | DateTime? start_date { get; set; } 38 | DateTime? finish_date { get; set; } 39 | List work_units { get; set; } 40 | List roadmap { get; set; } 41 | DateTime created { get; set; } 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IDiscussion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IDiscussion 27 | { 28 | ulong id { get; set; } 29 | ulong reply_to { get; set; } 30 | ulong sender_id { get; set; } 31 | string sender_name { get; set; } 32 | //ulong send_to_id { get; set; } 33 | //string send_to_name { get; set; } 34 | //string send_to_group { get; set; } 35 | ulong product_id { get; set; } 36 | ulong module_id { get; set; } 37 | ulong feature_id { get; set; } 38 | ulong issues_id { get; set; } 39 | ulong task_id { get; set; } 40 | ulong test_record_id { get; set; } 41 | string content { get; set; } 42 | DateTime created { get; set; } 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/layout/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 48 | 49 | 99 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/assets/css/app.less: -------------------------------------------------------------------------------- 1 | .clearfix:before, 2 | .clearfix:after { 3 | content: "\0020"; 4 | display: block; 5 | height: 0; 6 | visibility: hidden; 7 | } 8 | .clearfix { 9 | zoom: 1; 10 | } 11 | .clearfix:after { 12 | clear: both; 13 | } 14 | * html .clearfix { 15 | zoom: 1; 16 | } 17 | *:first-child + html .clearfix { 18 | zoom: 1; 19 | } 20 | .hidden { 21 | border: 0 !important; 22 | clip: rect(1px 1px 1px 1px); 23 | clip: rect(1px, 1px, 1px, 1px); 24 | height: 1px !important; 25 | margin: -1px; 26 | overflow: hidden; 27 | padding: 0 !important; 28 | position: absolute !important; 29 | width: 1px; 30 | } 31 | .display-block { 32 | display: block; 33 | } 34 | .display-none, 35 | .display-hide { 36 | display: none; 37 | } 38 | .inline { 39 | display: inline; 40 | } 41 | .text-right { 42 | text-align: right !important; 43 | } 44 | .text-left { 45 | text-align: left !important; 46 | } 47 | .text-center { 48 | text-align: center !important; 49 | } 50 | .pull-left { 51 | float: left !important; 52 | } 53 | .pull-right { 54 | float: right !important; 55 | } 56 | 57 | /****/ 58 | pre { 59 | font-size: 12px; 60 | padding: 16px; 61 | background-color: rgba(0, 69, 120, 1); 62 | color: #fff; 63 | text-overflow: clip; 64 | word-break: break-all; 65 | word-wrap: break-word; 66 | border: 1px solid #d3d3d3; 67 | border-radius: 3px; 68 | white-space: pre-wrap; 69 | font-size: 14px; 70 | display: block; 71 | } 72 | 73 | /*****/ 74 | .search-bar { 75 | margin-bottom: 15px; 76 | 77 | .searbar-button { 78 | text-align: center; 79 | } 80 | } 81 | 82 | .table-toolbar { 83 | margin-bottom: 10px; 84 | 85 | .el-button-group + .el-button-group { 86 | margin-left: 10px; 87 | } 88 | } 89 | 90 | .table-searchbar { 91 | // margin-bottom: 10px; 92 | } 93 | 94 | .table-footer { 95 | margin-top: 10px; 96 | } 97 | 98 | .btn-block { 99 | width: 100%; 100 | display: block; 101 | } 102 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/layout/top.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 67 | 68 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/AglieProjectRepo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using MySql.Data.MySqlClient; 4 | using System.Linq; 5 | using Dapper; 6 | using Dapper.Contrib; 7 | using Dapper.Contrib.Extensions; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.Data.SqlClient; 11 | using GoGoGo.Entity; 12 | using GoGoGo.Abstract.Entity; 13 | 14 | namespace GoGoGo.DataStorage 15 | { 16 | /* 17 | Copyright (C) 2019 Jiang Ming Feng 18 | Github: https://github.com/mfjiang 19 | Contact: hamlet.jiang@live.com 20 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 21 | 22 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 23 | 24 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 25 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | 28 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 29 | 30 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 31 | 32 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 33 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 34 | */ 35 | 36 | public class AglieProjectRepo : DataRepoBase 37 | { 38 | public AglieProjectRepo(string connStr) : base(connStr) 39 | { 40 | 41 | } 42 | 43 | public DataSet GetDataPage(string sqlQuery, string orderBy, int pageSize = 50, int pageNo = 1, string fields = "*") 44 | { 45 | return base.GetDataPage(sqlQuery, orderBy, "aglie_project", pageSize, pageNo, fields); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /GoGoGo.Entity/ProductFeature.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("product_feature")] 31 | public class ProductFeature:IProductFeature 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public ulong product_id { get; set; } 36 | public ulong module_id { get; set; } 37 | public ulong creator_id { get; set; } 38 | public ulong last_editor_id { get; set; } 39 | public string title { get; set; } 40 | public string remark { get; set; } 41 | public int level { get; set; } 42 | public int state { get; set; } 43 | public DateTime created { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/ITestRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface ITestRecord 27 | { 28 | ulong id { get; set; } 29 | ulong version_id { get; set; } 30 | ulong product_id { get; set; } 31 | ulong module_id { get; set; } 32 | ulong use_case_id { get; set; } 33 | ulong creator_id { get; set; } 34 | ulong confirm_by_id { get; set; } 35 | string remark { get; set; } 36 | int report_type { get; set; } 37 | ulong report_to { get; set; } 38 | ulong tester_id { get; set; } 39 | string report_to_cc { get; set; } 40 | int level { get; set; } 41 | int state { get; set; } 42 | DateTime? confirm_time { get; set; } 43 | DateTime? close_time { get; set; } 44 | DateTime created { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /LogManCore/LogLevel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LogMan 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | /// 30 | /// 表示输出日志的级别 31 | /// 32 | public enum LogLevel : int 33 | { 34 | /// 35 | /// 未配置 36 | /// 37 | Unknown, 38 | /// 39 | /// 什么也不输出 40 | /// 41 | None, 42 | /// 43 | /// 一般消息 44 | /// 45 | Info, 46 | /// 47 | /// 警告 48 | /// 49 | Warn, 50 | /// 51 | /// 一般异常 52 | /// 53 | Error, 54 | /// 55 | /// 致命异常 56 | /// 57 | Fatal 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public interface IUser 28 | { 29 | ulong id { get; set; } 30 | string mobile_no { get; set; } 31 | string wx_uuid { get; set; } 32 | string wx_name { get; set; } 33 | string wx_avata_url { get; set; } 34 | string nick_name { get; set; } 35 | string real_name { get; set; } 36 | string title { get; set; } 37 | string pwd { get; set; } 38 | string work_groups { get; set; } 39 | string roles { get; set; } 40 | string employee_no { get; set; } 41 | string email { get; set; } 42 | bool is_banned { get; set; } 43 | DateTime? last_login_date { get; set; } 44 | string last_session_id { get; set; } 45 | string last_login_ip { get; set; } 46 | DateTime created { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Gogogo.IF/Flags.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | public enum TestReportType : int 28 | { 29 | Bug = 1, 30 | Suggestion, 31 | Improvement 32 | } 33 | 34 | //todo: Make product types and task types configurable. 35 | 36 | public enum DefaultTaskType : int 37 | { 38 | Standard = 100, 39 | ProjectManagement, 40 | ArchitectureDesign, 41 | ProductDesign, 42 | UIDesign, 43 | UEDesign, 44 | MediaDesign, 45 | Development, 46 | Research, 47 | Documention, 48 | Test, 49 | Publish, 50 | Deploy 51 | } 52 | 53 | public enum DefaultProductType : int 54 | { 55 | Software = 1000, 56 | SystemIntegration, 57 | BuildingsAndInfrastructure, 58 | IdesaAndDesign, 59 | ResearchSubjects, 60 | TechnicalEquipments 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Gogogo.IF/Entity/IWorkTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GoGoGo.Abstract.Entity 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | public interface IWorkTask 27 | { 28 | ulong id { get; set; } 29 | ulong creator_id { get; set; } 30 | ulong executor_id { get; set; } 31 | int task_type { get; set; } 32 | string title { get; set; } 33 | int level { get; set; } 34 | int state { get; set; } 35 | ulong workunit_id { get; set; } 36 | ulong test_record_id { get; set; } 37 | int confirm_state { get; set; } // confirm if access the task by executor member 38 | int review_state { get; set; } // review the task by manager 39 | ulong confirm_by_id { get; set; } 40 | ulong review_by_id { get; set; } 41 | DateTime? confirm_time { get; set; } 42 | DateTime? review_time { get; set; } 43 | DateTime? close_time { get; set; } 44 | DateTime created { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /GoGoGo.Entity/ProductModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("product_module")] 31 | public class ProductModule: IProductModule 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public string module_code { get; set; } 36 | public ulong creator_id { get; set; } 37 | public ulong last_editor_id { get; set; } 38 | public ulong version_id { get; set; } 39 | public ulong parent_id { get; set; } 40 | public ulong product_id { get; set; } 41 | public string title { get; set; } 42 | public string remark { get; set; } 43 | public int level { get; set; } 44 | public int state { get; set; } 45 | public DateTime created { get; set; } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /LogManCore/LogAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LogMan 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | /// 30 | /// 表示自定义日志输出的属性类 31 | /// 32 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false)] 33 | public class LogAttribute : Attribute 34 | { 35 | /// 36 | /// 获取或设置日志级别 37 | /// 38 | public LogLevel LogLevel { get; set; } 39 | 40 | /// 41 | /// 获取或设置日志名 42 | /// 43 | public string LogName { get; set; } 44 | 45 | /// 46 | /// 获取或设置日志文件后缀 如 .log 47 | /// 48 | public string FileSuffix { get; set; } 49 | 50 | /// 51 | /// 获取或设置自动清理日志的天数 52 | /// 53 | public int AutoCleanDays { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /GoGoGo.Entity/UseCase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("usecase")] 31 | public class UseCase:IUseCase 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public ulong product_id { get; set; } 36 | public ulong module_id { get; set; } 37 | public ulong creator_id { get; set; } 38 | public ulong last_editor_id { get; set; } 39 | public string test_path { get; set; } 40 | public string remark { get; set; } 41 | public string paramas { get; set; } 42 | public string expected_results { get; set; } 43 | public string tested_results { get; set; } 44 | public bool quality_pass { get; set; } 45 | public int state { get; set; } 46 | public DateTime created { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /GoGoGo.Entity/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("product")] 31 | public class Product:IProduct 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public int product_type { get; set; } 36 | public string code { get; set; } 37 | public string name { get; set; } 38 | public string remark { get; set; } 39 | public string main_ver { get; set; } 40 | public string source_uri { get; set; } 41 | public string open_api_uri { get; set; } 42 | public ulong creator_id { get; set; } 43 | public ulong last_editor_id { get; set; } 44 | public int level { get; set; } 45 | public int state { get; set; } 46 | public DateTime? last_updated { get; set; } 47 | public DateTime created { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/views/login/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 68 | 69 | -------------------------------------------------------------------------------- /GoGoGo.Entity/WorkUnit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | [Serializable] 29 | [Table("work_unit")] 30 | public class WorkUnit : IWorkUnit 31 | { 32 | [Key] 33 | public ulong id { get; set; } 34 | public ulong project_id { get; set; } 35 | public ulong parent_id { get; set; } 36 | public ulong product_id { get; set; } 37 | public ulong version_id { get; set; } 38 | public ulong module_id { get; set; } 39 | public ulong creator_id { get; set; } 40 | public ulong executor_id { get; set; } 41 | public string members { get; set; } 42 | public string title { get; set; } 43 | public DateTime? start_date { get; set; } 44 | public DateTime? finish_date { get; set; } 45 | public int level { get; set; } 46 | public int state { get; set; } 47 | public DateTime created { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GoGoGo.Entity/AglieProject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | using GoGoGo.Abstract.Entity; 7 | 8 | namespace GoGoGo.Entity 9 | { 10 | /* 11 | Copyright (C) 2019 Jiang Ming Feng 12 | Github: https://github.com/mfjiang 13 | Contact: hamlet.jiang@live.com 14 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 15 | 16 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 17 | 18 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 19 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 23 | 24 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 25 | 26 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 27 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 | */ 29 | 30 | [Serializable] 31 | [Table("aglie_project")] 32 | public class AglieProject : IAgileProject 33 | { 34 | [Key] 35 | public ulong id { get; set; } 36 | public string title { get; set; } 37 | public ulong creator_id { get; set; } 38 | public ulong last_editor_id { get; set; } 39 | public ulong chife_manager_id { get; set; } 40 | public ulong executor_id { get; set; } 41 | public int level { get; set; } 42 | public int state { get; set; } 43 | public DateTime? start_date { get; set; } 44 | public DateTime? finish_date { get; set; } 45 | public List work_units { get; set; } 46 | public List roadmap { get; set; } 47 | public DateTime created { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GoGoGo.Entity/Discussion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | using GoGoGo.Abstract.Entity; 7 | 8 | namespace GoGoGo.Entity 9 | { 10 | /* 11 | Copyright (C) 2019 Jiang Ming Feng 12 | Github: https://github.com/mfjiang 13 | Contact: hamlet.jiang@live.com 14 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 15 | 16 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 17 | 18 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 19 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 23 | 24 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 25 | 26 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 27 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 | */ 29 | 30 | [Serializable] 31 | [Table("discussion")] 32 | public class Discussion : IDiscussion 33 | { 34 | [Key] 35 | public ulong id { get; set; } 36 | public ulong reply_to { get; set; } 37 | public ulong sender_id { get; set; } 38 | public string sender_name { get; set; } 39 | //public ulong send_to_id { get; set; } 40 | //public string send_to_name { get; set; } 41 | //public string send_to_group { get; set; } 42 | public ulong product_id { get; set; } 43 | public ulong module_id { get; set; } 44 | public ulong feature_id { get; set; } 45 | public ulong issues_id { get; set; } 46 | public ulong task_id { get; set; } 47 | public ulong test_record_id { get; set; } 48 | public string content { get; set; } 49 | public DateTime created { get; set; } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/MySqlNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace DotNetCoreConfiguration 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | /// 28 | /// 表示用于json配置文件的MYSQL集群配置节点信息类 29 | /// 30 | public class MySqlNode 31 | { 32 | public MySqlNode() { } 33 | 34 | /// 35 | /// 节点在配置中的ID 36 | /// 37 | public int ID { get; set; } 38 | 39 | /// 40 | /// 是否为从库节点 41 | /// 42 | public bool IsSlave { get; set; } 43 | 44 | /// 45 | /// 数据库名称 46 | /// 47 | public string DataBasesName { get; set; } 48 | 49 | /// 50 | /// 连接串 51 | /// 52 | public string ConnStr { get; set; } 53 | 54 | /// 55 | /// 分库的主库ID(0表示非分库) 56 | /// 57 | public int DevideFromNodeID { get; set; } 58 | 59 | /// 60 | /// 分库的分表设置例:table 1:hash key,table 2:hash key,table n:hash key 61 | /// 62 | public string DevideDataSet { get; set; } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /GoGoGo.Entity/TestRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("test_record")] 31 | public class TestRecord:ITestRecord 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public ulong version_id { get; set; } 36 | public ulong product_id { get; set; } 37 | public ulong module_id { get; set; } 38 | public ulong use_case_id { get; set; } 39 | public ulong creator_id { get; set; } 40 | public ulong confirm_by_id { get; set; } 41 | public string remark { get; set; } 42 | public int report_type { get; set; } 43 | public ulong report_to { get; set; } 44 | public ulong tester_id { get; set; } 45 | public string report_to_cc { get; set; } 46 | public int level { get; set; } 47 | public int state { get; set; } 48 | public DateTime? confirm_time { get; set; } 49 | public DateTime? close_time { get; set; } 50 | public DateTime created { get; set; } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Logging; 11 | using Microsoft.Extensions.Options; 12 | using Newtonsoft.Json; 13 | using Swashbuckle.AspNetCore.Swagger; 14 | 15 | namespace GoGoGo.WebApp 16 | { 17 | public class Startup 18 | { 19 | public Startup(IConfiguration configuration) 20 | { 21 | Configuration = configuration; 22 | } 23 | 24 | public IConfiguration Configuration { get; } 25 | 26 | // This method gets called by the runtime. Use this method to add services to the container. 27 | public void ConfigureServices(IServiceCollection services) 28 | { 29 | services.AddMvc() 30 | .AddMvcOptions(options=> { 31 | options.EnableEndpointRouting = false; 32 | }) 33 | .AddJsonOptions(options => 34 | { 35 | options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Local; 36 | options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; 37 | #if DEBUG 38 | options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Error; 39 | #else 40 | options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; 41 | #endif 42 | }) 43 | .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); 44 | 45 | services.AddSpaStaticFiles(config => config.RootPath = "ClientApp/dist"); 46 | 47 | services.AddSwaggerGen(c => 48 | { 49 | c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); 50 | }); 51 | 52 | 53 | } 54 | 55 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 56 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 57 | { 58 | if (env.IsDevelopment()) 59 | { 60 | app.UseDeveloperExceptionPage(); 61 | } 62 | 63 | app.UseStaticFiles(); 64 | 65 | app.UseSpaStaticFiles(); 66 | 67 | app.UseMvcWithDefaultRoute(); 68 | 69 | app.UseSwagger(); 70 | 71 | app.UseSwaggerUI(c => 72 | { 73 | c.SwaggerEndpoint("/swagger/v1/swagger.json", "v1"); 74 | }); 75 | 76 | app.UseSpa(b => 77 | { 78 | if (env.IsDevelopment()) 79 | { 80 | #if DEBUG 81 | // 注释下面这行,如果没有启动前端 82 | // b.UseProxyToSpaDevelopmentServer("http://localhost:8080"); 83 | #endif 84 | } 85 | }); 86 | 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /GoGoGo.Entity/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | using GoGoGo.Abstract.Entity; 7 | 8 | namespace GoGoGo.Entity 9 | { 10 | /* 11 | Copyright (C) 2019 Jiang Ming Feng 12 | Github: https://github.com/mfjiang 13 | Contact: hamlet.jiang@live.com 14 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 15 | 16 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 17 | 18 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 19 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 23 | 24 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 25 | 26 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 27 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 | */ 29 | 30 | [Serializable] 31 | [Table("user")] 32 | public class User:IUser 33 | { 34 | [Key] 35 | public ulong id { get; set; } 36 | public string mobile_no { get; set; } 37 | public string wx_uuid { get; set; } 38 | public string wx_name { get; set; } 39 | public string wx_avata_url { get; set; } 40 | public string nick_name { get; set; } 41 | public string real_name { get; set; } 42 | public string title { get; set; } 43 | public string pwd { get; set; } 44 | public string work_groups { get; set; } 45 | public string roles { get; set; } 46 | public string employee_no { get; set; } 47 | public string email { get; set; } 48 | public bool is_banned { get; set; } 49 | public DateTime? last_login_date { get; set; } 50 | public string last_session_id { get; set; } 51 | public string last_login_ip { get; set; } 52 | public DateTime created { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /GoGoGo.Entity/WorkTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Text; 5 | using GoGoGo.Abstract.Entity; 6 | 7 | namespace GoGoGo.Entity 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | [Serializable] 30 | [Table("work_task")] 31 | public class WorkTask:IWorkTask 32 | { 33 | [Key] 34 | public ulong id { get; set; } 35 | public ulong creator_id { get; set; } 36 | public ulong executor_id { get; set; } 37 | public int task_type { get; set; } 38 | public string title { get; set; } 39 | public int level { get; set; } 40 | public int state { get; set; } 41 | public ulong workunit_id { get; set; } 42 | public ulong test_record_id { get; set; } 43 | public int confirm_state { get; set; } // confirm if access the task by principal member 44 | public int review_state { get; set; } // review the task by manager 45 | public DateTime? confirm_time { get; set; } 46 | public DateTime? review_time { get; set; } 47 | public DateTime? close_time { get; set; } 48 | public ulong confirm_by_id { get; set; } 49 | public ulong review_by_id { get; set; } 50 | public DateTime created { get; set; } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/MySqlClusterSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace DotNetCoreConfiguration 6 | { 7 | /* 8 | Copyright (C) 2019 Jiang Ming Feng 9 | Github: https://github.com/mfjiang 10 | Contact: hamlet.jiang@live.com 11 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 12 | 13 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 14 | 15 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 16 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 20 | 21 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 22 | 23 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | */ 26 | 27 | /// 28 | /// 表示用于json配置文件的MYSQL集群配置信息类 29 | /// 分库是扩展存储容量 30 | /// 从库是数据镜像和读分流 31 | /// 32 | public class MySqlClusterSettings 33 | { 34 | List m_Nodes; 35 | 36 | public MySqlClusterSettings() 37 | { 38 | m_Nodes = new List(); 39 | } 40 | 41 | /// 42 | /// 配置中的节点清单 43 | /// 44 | public List Nodes { get { return m_Nodes; } set { m_Nodes = value; } } 45 | 46 | /// 47 | /// 取主库 48 | /// 49 | /// 数据库名称 50 | /// 51 | public MySqlNode GetMaster(string dbname) 52 | { 53 | var temp = m_Nodes.Find(n => n.IsSlave == false & n.DevideFromNodeID == 0 & n.DataBasesName.ToLower().Equals(dbname.ToLower())); 54 | return temp; 55 | } 56 | 57 | /// 58 | /// 取从库 59 | /// 60 | /// 数据库名称 61 | /// 62 | public MySqlNode GetSlave(string dbname) 63 | { 64 | var temp = m_Nodes.Find(n => n.IsSlave == true & n.DevideFromNodeID == 0 & n.DataBasesName.ToLower().Equals(dbname.ToLower())); 65 | return temp; 66 | } 67 | 68 | /// 69 | /// 取分库 70 | /// 71 | /// 数据库名称 72 | /// 主库节点ID 73 | /// 74 | public MySqlNode GetDevide(string dbname, int devideFromMasterID) 75 | { 76 | var temp = m_Nodes.Find(n => n.DevideFromNodeID == devideFromMasterID & n.DataBasesName.ToLower().Equals(dbname.ToLower())); 77 | return temp; 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /GoGoGo.WebApp/ClientApp/src/components/count-to/count-to.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 191 | -------------------------------------------------------------------------------- /GoGoGo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29102.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.Abstract", "Gogogo.IF\GoGoGo.Abstract.csproj", "{DE364D31-7D24-4A7A-9B35-A740342B469C}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogManCore", "LogManCore\LogManCore.csproj", "{F9854437-9251-4B49-AC31-F7346AFE6FBE}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCoreConfiguration", "DotNetCoreConfiguration\DotNetCoreConfiguration.csproj", "{F3E5AA52-CBAA-49DC-AEA9-9CD512535A64}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.Entity", "GoGoGo.Entity\GoGoGo.Entity.csproj", "{52A2671A-E28D-468A-9A0A-4752D7C47E2B}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.DataStorage", "GoGoGo.DataStorage\GoGoGo.DataStorage.csproj", "{B8F7E717-E387-4E89-8EAE-9FA0868123C7}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.Core", "GoGoGo.Core\GoGoGo.Core.csproj", "{BF3D7CC9-B79C-46B2-827D-7FC0DAD9041D}" 17 | EndProject 18 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.DataStorage.UnitTest", "UnitTest\GoGoGo.DataStorage.UnitTest\GoGoGo.DataStorage.UnitTest.csproj", "{49404C16-C8E0-457C-81F4-73D4CB2CAAB6}" 19 | EndProject 20 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GoGoGo.WebApp", "GoGoGo.WebApp\GoGoGo.WebApp.csproj", "{16137B30-D5E4-4DEA-B036-7885837A3C0E}" 21 | EndProject 22 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8A0E22A-B1E2-49C7-AF86-1A36C1502938}" 23 | ProjectSection(SolutionItems) = preProject 24 | .editorconfig = .editorconfig 25 | EndProjectSection 26 | EndProject 27 | Global 28 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 29 | Debug|Any CPU = Debug|Any CPU 30 | Release|Any CPU = Release|Any CPU 31 | EndGlobalSection 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 33 | {DE364D31-7D24-4A7A-9B35-A740342B469C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {DE364D31-7D24-4A7A-9B35-A740342B469C}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {DE364D31-7D24-4A7A-9B35-A740342B469C}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {DE364D31-7D24-4A7A-9B35-A740342B469C}.Release|Any CPU.Build.0 = Release|Any CPU 37 | {F9854437-9251-4B49-AC31-F7346AFE6FBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 38 | {F9854437-9251-4B49-AC31-F7346AFE6FBE}.Debug|Any CPU.Build.0 = Debug|Any CPU 39 | {F9854437-9251-4B49-AC31-F7346AFE6FBE}.Release|Any CPU.ActiveCfg = Release|Any CPU 40 | {F9854437-9251-4B49-AC31-F7346AFE6FBE}.Release|Any CPU.Build.0 = Release|Any CPU 41 | {F3E5AA52-CBAA-49DC-AEA9-9CD512535A64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 42 | {F3E5AA52-CBAA-49DC-AEA9-9CD512535A64}.Debug|Any CPU.Build.0 = Debug|Any CPU 43 | {F3E5AA52-CBAA-49DC-AEA9-9CD512535A64}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {F3E5AA52-CBAA-49DC-AEA9-9CD512535A64}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {52A2671A-E28D-468A-9A0A-4752D7C47E2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 46 | {52A2671A-E28D-468A-9A0A-4752D7C47E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU 47 | {52A2671A-E28D-468A-9A0A-4752D7C47E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {52A2671A-E28D-468A-9A0A-4752D7C47E2B}.Release|Any CPU.Build.0 = Release|Any CPU 49 | {B8F7E717-E387-4E89-8EAE-9FA0868123C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 50 | {B8F7E717-E387-4E89-8EAE-9FA0868123C7}.Debug|Any CPU.Build.0 = Debug|Any CPU 51 | {B8F7E717-E387-4E89-8EAE-9FA0868123C7}.Release|Any CPU.ActiveCfg = Release|Any CPU 52 | {B8F7E717-E387-4E89-8EAE-9FA0868123C7}.Release|Any CPU.Build.0 = Release|Any CPU 53 | {BF3D7CC9-B79C-46B2-827D-7FC0DAD9041D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 | {BF3D7CC9-B79C-46B2-827D-7FC0DAD9041D}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 | {BF3D7CC9-B79C-46B2-827D-7FC0DAD9041D}.Release|Any CPU.ActiveCfg = Release|Any CPU 56 | {BF3D7CC9-B79C-46B2-827D-7FC0DAD9041D}.Release|Any CPU.Build.0 = Release|Any CPU 57 | {49404C16-C8E0-457C-81F4-73D4CB2CAAB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 58 | {49404C16-C8E0-457C-81F4-73D4CB2CAAB6}.Debug|Any CPU.Build.0 = Debug|Any CPU 59 | {49404C16-C8E0-457C-81F4-73D4CB2CAAB6}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 | {49404C16-C8E0-457C-81F4-73D4CB2CAAB6}.Release|Any CPU.Build.0 = Release|Any CPU 61 | {16137B30-D5E4-4DEA-B036-7885837A3C0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 62 | {16137B30-D5E4-4DEA-B036-7885837A3C0E}.Debug|Any CPU.Build.0 = Debug|Any CPU 63 | {16137B30-D5E4-4DEA-B036-7885837A3C0E}.Release|Any CPU.ActiveCfg = Release|Any CPU 64 | {16137B30-D5E4-4DEA-B036-7885837A3C0E}.Release|Any CPU.Build.0 = Release|Any CPU 65 | EndGlobalSection 66 | GlobalSection(SolutionProperties) = preSolution 67 | HideSolutionNode = FALSE 68 | EndGlobalSection 69 | GlobalSection(ExtensibilityGlobals) = postSolution 70 | SolutionGuid = {E410A2FA-0848-4E10-A74E-85DCC53C13D6} 71 | EndGlobalSection 72 | EndGlobal 73 | -------------------------------------------------------------------------------- /DotNetCoreConfiguration/ConfigurationManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Reflection; 6 | 7 | namespace DotNetCoreConfiguration 8 | { 9 | /* 10 | Copyright (C) 2019 Jiang Ming Feng 11 | Github: https://github.com/mfjiang 12 | Contact: hamlet.jiang@live.com 13 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 14 | 15 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 16 | 17 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 18 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | 21 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 22 | 23 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 24 | 25 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 26 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 27 | */ 28 | 29 | /// 30 | /// 实现.net core环境的配置文件操作方法,以替代.net framework 中的同名类 31 | /// 默认使用当前目录下的appsettings.json文件 32 | /// 33 | public static class ConfigurationManager 34 | { 35 | #region 私有字段 36 | private static IConfigurationBuilder m_ConfigBuilder; 37 | private static IConfigurationRoot m_ConfigRoot; 38 | #endregion 39 | 40 | /// 41 | /// 获取JsonConfig对象 42 | /// 43 | public static IConfigurationRoot JsonConfig { get { return m_ConfigRoot; } } 44 | 45 | static ConfigurationManager() 46 | { 47 | string path = Directory.GetCurrentDirectory(); 48 | 49 | if (!File.Exists(path + "\\appsettings.json")) 50 | { 51 | Assembly assembly = Assembly.GetExecutingAssembly(); 52 | string loc = assembly.Location; 53 | FileInfo ff = new FileInfo(loc); 54 | path = ff.DirectoryName; 55 | } 56 | 57 | m_ConfigBuilder = new ConfigurationBuilder().SetBasePath(path).AddJsonFile("appsettings.json"); 58 | m_ConfigRoot = m_ConfigBuilder.Build(); 59 | } 60 | 61 | /// 62 | ///以实体的形式读取AppSettings节点下的值 63 | /// 64 | public static AppSettings GetAppConfig() 65 | { 66 | AppSettings cfg = new AppSettings(); 67 | 68 | m_ConfigRoot.GetSection("AppSettings").Bind(cfg); 69 | 70 | return cfg; 71 | } 72 | 73 | /// 74 | /// 读取AppSettings节点下的指定KEY的值 75 | /// 76 | /// 键名 77 | /// 78 | public static string GetAppConfig(string key) 79 | { 80 | string cfg = String.Empty; 81 | 82 | cfg = m_ConfigRoot.GetSection("AppSettings").GetValue(key); 83 | 84 | return cfg; 85 | } 86 | 87 | /// 88 | /// 以实体的形式读取MySqlClusterSettings节点下的值 89 | /// 90 | /// 91 | public static MySqlClusterSettings GetMySqlClusterSettings() 92 | { 93 | MySqlClusterSettings cfg = new MySqlClusterSettings(); 94 | var ie = m_ConfigRoot.GetSection("MySqlClusterSettings:Nodes").GetChildren().GetEnumerator(); 95 | int i = 0; 96 | while (ie.MoveNext()) 97 | { 98 | string path = ie.Current.Path + ":MySqlNode"; 99 | MySqlNode node = new MySqlNode(); 100 | m_ConfigRoot.GetSection(path).Bind(node); 101 | cfg.Nodes.Add(node); 102 | i += 1; 103 | } 104 | return cfg; 105 | } 106 | 107 | /// 108 | /// 指定节点和键名取值 109 | /// 110 | /// 节点 111 | /// 键名 112 | /// 113 | public static string GetValue(string sectionName, string key) 114 | { 115 | string cfg = String.Empty; 116 | 117 | var section = m_ConfigRoot.GetSection(sectionName); 118 | if (section != null) 119 | { 120 | cfg = section.GetValue(key); 121 | } 122 | return cfg; 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | 33 | # Visual Studio 2015/2017 cache/options directory 34 | .vs/ 35 | # Uncomment if you have tasks that create the project's static files in wwwroot 36 | #wwwroot/ 37 | 38 | # Visual Studio 2017 auto generated files 39 | Generated\ Files/ 40 | 41 | # MSTest test Results 42 | [Tt]est[Rr]esult*/ 43 | [Bb]uild[Ll]og.* 44 | 45 | # NUnit 46 | *.VisualState.xml 47 | TestResult.xml 48 | nunit-*.xml 49 | 50 | # Build Results of an ATL Project 51 | [Dd]ebugPS/ 52 | [Rr]eleasePS/ 53 | dlldata.c 54 | 55 | # Benchmark Results 56 | BenchmarkDotNet.Artifacts/ 57 | 58 | # .NET Core 59 | project.lock.json 60 | project.fragment.lock.json 61 | artifacts/ 62 | 63 | # StyleCop 64 | StyleCopReport.xml 65 | 66 | # Files built by Visual Studio 67 | *_i.c 68 | *_p.c 69 | *_h.h 70 | *.ilk 71 | *.meta 72 | *.obj 73 | *.iobj 74 | *.pch 75 | *.pdb 76 | *.ipdb 77 | *.pgc 78 | *.pgd 79 | *.rsp 80 | *.sbr 81 | *.tlb 82 | *.tli 83 | *.tlh 84 | *.tmp 85 | *.tmp_proj 86 | *_wpftmp.csproj 87 | *.log 88 | *.vspscc 89 | *.vssscc 90 | .builds 91 | *.pidb 92 | *.svclog 93 | *.scc 94 | 95 | # Chutzpah Test files 96 | _Chutzpah* 97 | 98 | # Visual C++ cache files 99 | ipch/ 100 | *.aps 101 | *.ncb 102 | *.opendb 103 | *.opensdf 104 | *.sdf 105 | *.cachefile 106 | *.VC.db 107 | *.VC.VC.opendb 108 | 109 | # Visual Studio profiler 110 | *.psess 111 | *.vsp 112 | *.vspx 113 | *.sap 114 | 115 | # Visual Studio Trace Files 116 | *.e2e 117 | 118 | # TFS 2012 Local Workspace 119 | $tf/ 120 | 121 | # Guidance Automation Toolkit 122 | *.gpState 123 | 124 | # ReSharper is a .NET coding add-in 125 | _ReSharper*/ 126 | *.[Rr]e[Ss]harper 127 | *.DotSettings.user 128 | 129 | # JustCode is a .NET coding add-in 130 | .JustCode 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # NuGet Symbol Packages 190 | *.snupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | *.appxbundle 216 | *.appxupload 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- [Bb]ackup.rdl 267 | *- [Bb]ackup ([0-9]).rdl 268 | *- [Bb]ackup ([0-9][0-9]).rdl 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # GhostDoc plugin setting file 274 | *.GhostDoc.xml 275 | 276 | # Node.js Tools for Visual Studio 277 | .ntvs_analysis.dat 278 | node_modules/ 279 | 280 | # Visual Studio 6 build log 281 | *.plg 282 | 283 | # Visual Studio 6 workspace options file 284 | *.opt 285 | 286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 287 | *.vbw 288 | 289 | # Visual Studio LightSwitch build output 290 | **/*.HTMLClient/GeneratedArtifacts 291 | **/*.DesktopClient/GeneratedArtifacts 292 | **/*.DesktopClient/ModelManifest.xml 293 | **/*.Server/GeneratedArtifacts 294 | **/*.Server/ModelManifest.xml 295 | _Pvt_Extensions 296 | 297 | # Paket dependency manager 298 | .paket/paket.exe 299 | paket-files/ 300 | 301 | # FAKE - F# Make 302 | .fake/ 303 | 304 | # CodeRush personal settings 305 | .cr/personal 306 | 307 | # Python Tools for Visual Studio (PTVS) 308 | __pycache__/ 309 | *.pyc 310 | 311 | # Cake - Uncomment if you are using it 312 | # tools/** 313 | # !tools/packages.config 314 | 315 | # Tabs Studio 316 | *.tss 317 | 318 | # Telerik's JustMock configuration file 319 | *.jmconfig 320 | 321 | # BizTalk build output 322 | *.btp.cs 323 | *.btm.cs 324 | *.odx.cs 325 | *.xsd.cs 326 | 327 | # OpenCover UI analysis results 328 | OpenCover/ 329 | 330 | # Azure Stream Analytics local run output 331 | ASALocalRun/ 332 | 333 | # MSBuild Binary and Structured Log 334 | *.binlog 335 | 336 | # NVidia Nsight GPU debugger configuration file 337 | *.nvuser 338 | 339 | # MFractors (Xamarin productivity tool) working folder 340 | .mfractor/ 341 | 342 | # Local History for Visual Studio 343 | .localhistory/ 344 | 345 | # BeatPulse healthcheck temp database 346 | healthchecksdb 347 | 348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 349 | MigrationBackup/ 350 | 351 | # Ionide (cross platform F# VS Code tools) working folder 352 | .ionide/ -------------------------------------------------------------------------------- /GoGoGo.Core/UserManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Linq; 4 | using System.Collections.Generic; 5 | using GoGoGo.DataStorage; 6 | using Dapper; 7 | using System.Data; 8 | using GoGoGo.Abstract; 9 | using GoGoGo.Abstract.Entity; 10 | using GoGoGo.Entity; 11 | 12 | namespace GoGoGo.Core 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | /// 35 | /// Provide manage functions for user 36 | /// 37 | public class UserManager : IUserManager 38 | { 39 | #region private fields 40 | private UserRepo m_UserRepo; 41 | private UserGroupRepo m_UserGroupRepo; 42 | private string m_ConnStr; 43 | #endregion 44 | 45 | public UserManager(string connstr) 46 | { 47 | if (String.IsNullOrEmpty(connstr)) 48 | { 49 | throw new ArgumentNullException("connstr"); 50 | } 51 | 52 | m_ConnStr = connstr; 53 | m_UserRepo = new UserRepo(connstr); 54 | m_UserGroupRepo = new UserGroupRepo(connstr); 55 | } 56 | 57 | #region interface implementation 58 | ulong IUserManager.AddUser(IUser user) 59 | { 60 | ulong uid = 0; 61 | uid = m_UserRepo.Insert(user); 62 | return uid; 63 | } 64 | 65 | bool IUserManager.Update(IUser user) 66 | { 67 | bool done = false; 68 | done = m_UserRepo.Update(user); 69 | return done; 70 | } 71 | 72 | bool IUserManager.DeleteUser(ulong id) 73 | { 74 | bool done = false; 75 | done = m_UserRepo.Delete("user", "id", id); 76 | return done; 77 | } 78 | IUser IUserManager.Get(ulong id) 79 | { 80 | return (IUser)m_UserRepo.Get(id); 81 | } 82 | 83 | List IUserManager.FindByNickName(string name) 84 | { 85 | DynamicParameters sp = new DynamicParameters(); 86 | sp.Add("@nick_name", name); 87 | var ul = Find("`nick_name` like concat('%',@nick_name,'%')", sp); 88 | return ul; 89 | } 90 | List IUserManager.FindByRealName(string name) 91 | { 92 | DynamicParameters sp = new DynamicParameters(); 93 | sp.Add("@real_name", name); 94 | var ul = Find("`real_name` like concat('%',@real_name,'%')", sp); 95 | return ul; 96 | } 97 | List IUserManager.FindByMoblie(string mobile) 98 | { 99 | DynamicParameters sp = new DynamicParameters(); 100 | sp.Add("@mobile_no", mobile); 101 | var ul = Find("`mobile_no` like concat('%',@mobile_no,'%')", sp); 102 | return ul; 103 | } 104 | List IUserManager.FindByEmail(string email) 105 | { 106 | DynamicParameters sp = new DynamicParameters(); 107 | sp.Add("@email", email); 108 | var ul = Find("`email` like concat('%',@email,'%')", sp); 109 | return ul; 110 | } 111 | 112 | DataSet IUserManager.GetDataPage(string sqlQuery, string orderBy, int pageSize, int pageNo, string fields) 113 | { 114 | if (pageSize <= 0) { pageSize = 50; } 115 | if (pageNo <= 0) { pageNo = 1; } 116 | if (String.IsNullOrEmpty(fields)) { fields = "*"; } 117 | return m_UserRepo.GetDataPage(sqlQuery, orderBy, pageSize, pageNo, fields); 118 | } 119 | 120 | #region about user group 121 | IUserGroup IUserManager.AddGroup(string groupName, ulong cratorId, params ulong[] userIds) 122 | { 123 | UserGroup group = null; 124 | 125 | if (!String.IsNullOrEmpty(groupName)) 126 | { 127 | group = new UserGroup(); 128 | group.created = DateTime.Now; 129 | group.creator_id = cratorId; 130 | group.group_name = groupName; 131 | group.users = ""; 132 | 133 | if (userIds.Length > 0) 134 | { 135 | var ids = ""; 136 | for (int i = 0; i < userIds.Length; i++) 137 | { 138 | ids += $"{userIds[i]},"; 139 | } 140 | } 141 | m_UserGroupRepo.Insert(group); 142 | } 143 | 144 | return group; 145 | } 146 | 147 | bool IUserManager.RemoveGroup(string groupName) 148 | { 149 | bool done = false; 150 | if (!String.IsNullOrEmpty(groupName)) 151 | { 152 | var temp = m_UserGroupRepo.Get(groupName); 153 | if (temp != null) 154 | { 155 | done = m_UserGroupRepo.Delete(temp); 156 | } 157 | } 158 | return done; 159 | } 160 | 161 | void IUserManager.MoveInGroup(string groupName, ulong userId) 162 | { 163 | if (!String.IsNullOrEmpty(groupName)) 164 | { 165 | var temp = m_UserGroupRepo.Get(groupName); 166 | if (temp != null) 167 | { 168 | string[] ids = temp.users.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); 169 | if (ids.Length > 0 && !ids.Contains(userId.ToString())) 170 | { 171 | temp.users = $"{temp.users},{userId}"; 172 | m_UserGroupRepo.Update(temp); 173 | } 174 | } 175 | } 176 | } 177 | 178 | void IUserManager.MoveOutGroup(string groupName, ulong userId) 179 | { 180 | if (!String.IsNullOrEmpty(groupName)) 181 | { 182 | var temp = m_UserGroupRepo.Get(groupName); 183 | if (temp != null) 184 | { 185 | string[] ids = temp.users.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); 186 | if (ids.Length > 0 && ids.Contains(userId.ToString())) 187 | { 188 | temp.users = ""; 189 | for (int i = 0; i < ids.Length; i++) 190 | { 191 | if (!ids[i].Equals(userId.ToString())) 192 | { 193 | temp.users += $"{ids[i]},"; 194 | } 195 | } 196 | 197 | m_UserGroupRepo.Update(temp); 198 | } 199 | } 200 | } 201 | } 202 | 203 | IUserGroup IUserManager.GetGroup(string groupName) 204 | { 205 | IUserGroup group = null; 206 | if (!String.IsNullOrEmpty(groupName)) 207 | { 208 | group = m_UserGroupRepo.Get(groupName); 209 | } 210 | return group; 211 | } 212 | 213 | List IUserManager.FindGroups(string groupName) 214 | { 215 | DynamicParameters sp = new DynamicParameters(); 216 | sp.Add("@group_name", groupName); 217 | var ugl = FindGroups("`group_name` like concat('%',@group_name,'%')", sp); 218 | return ugl; 219 | 220 | } 221 | #endregion 222 | 223 | #endregion 224 | 225 | private List FindGroups(string sqlQueryNoWhere, object paramas) 226 | { 227 | string querybase = $"select * from usergroup where {sqlQueryNoWhere.Replace("where", " ")} order by `group_name` asc limit 999"; 228 | List ls = new List(); 229 | CommandDefinition cmdd = new CommandDefinition(querybase, paramas, null, null, System.Data.CommandType.Text, CommandFlags.Buffered); 230 | 231 | var ul = m_UserGroupRepo.Query(cmdd); 232 | for (int i = 0; i < ul.Count(); i++) 233 | { 234 | ls.Add((IUserGroup)ul.ElementAt(i)); 235 | } 236 | return ls; 237 | } 238 | 239 | private List Find(string sqlQueryNoWhere, object paramas) 240 | { 241 | string querybase = $"select * from user where {sqlQueryNoWhere.Replace("where", " ")} order by `id` desc limit 100"; 242 | List ls = new List(); 243 | CommandDefinition cmdd = new CommandDefinition(querybase, paramas, null, null, System.Data.CommandType.Text, CommandFlags.None); 244 | 245 | var ul = m_UserRepo.Query(cmdd); 246 | if (ul != null && ul.Count() > 0) 247 | { 248 | for (int i = 0; i < ul.Count(); i++) 249 | { 250 | ls.Add((IUser)ul.ElementAt(i)); 251 | } 252 | } 253 | return ls; 254 | } 255 | } 256 | } 257 | -------------------------------------------------------------------------------- /Sql/GoGoGo.db.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: GoGoGo 4 | -- ------------------------------------------------------ 5 | -- Server version 5.6.38 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `aglie_project` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `aglie_project`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `aglie_project` ( 26 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 27 | `title` varchar(255) NOT NULL, 28 | `creator_id` bigint(20) unsigned DEFAULT '0', 29 | `last_editor_id` bigint(20) unsigned DEFAULT '0', 30 | `chife_manager_id` bigint(20) unsigned DEFAULT '0', 31 | `executor_id` bigint(20) unsigned DEFAULT '0', 32 | `remark` text, 33 | `level` int(10) DEFAULT '0', 34 | `state` int(10) DEFAULT '0', 35 | `start_date` datetime DEFAULT NULL, 36 | `finish_date` datetime DEFAULT NULL, 37 | `last_updated` datetime DEFAULT NULL, 38 | `created` datetime NOT NULL, 39 | PRIMARY KEY (`id`), 40 | UNIQUE KEY `id_UNIQUE` (`id`) 41 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 42 | /*!40101 SET character_set_client = @saved_cs_client */; 43 | 44 | -- 45 | -- Table structure for table `discussion` 46 | -- 47 | 48 | DROP TABLE IF EXISTS `discussion`; 49 | /*!40101 SET @saved_cs_client = @@character_set_client */; 50 | /*!40101 SET character_set_client = utf8 */; 51 | CREATE TABLE `discussion` ( 52 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 53 | `reply_to` bigint(20) unsigned NOT NULL DEFAULT '0', 54 | `sender_id` bigint(20) unsigned NOT NULL DEFAULT '0', 55 | `sender_name` varchar(255) NOT NULL, 56 | `product_id` bigint(20) unsigned NOT NULL DEFAULT '0', 57 | `module_id` bigint(20) unsigned NOT NULL DEFAULT '0', 58 | `feature_id` bigint(20) unsigned NOT NULL, 59 | `issues_id` bigint(20) unsigned NOT NULL DEFAULT '0', 60 | `task_id` bigint(20) unsigned NOT NULL DEFAULT '0', 61 | `test_record_id` bigint(20) unsigned NOT NULL DEFAULT '0', 62 | `content` text NOT NULL, 63 | `created` datetime NOT NULL, 64 | PRIMARY KEY (`id`) 65 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 66 | /*!40101 SET character_set_client = @saved_cs_client */; 67 | 68 | -- 69 | -- Table structure for table `issues` 70 | -- 71 | 72 | DROP TABLE IF EXISTS `issues`; 73 | /*!40101 SET @saved_cs_client = @@character_set_client */; 74 | /*!40101 SET character_set_client = utf8 */; 75 | CREATE TABLE `issues` ( 76 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 77 | `product_id` bigint(20) unsigned NOT NULL DEFAULT '0', 78 | `creator_id` bigint(20) unsigned NOT NULL, 79 | `last_editor_id` bigint(20) NOT NULL DEFAULT '0', 80 | `from_who` varchar(255) NOT NULL DEFAULT 'unknown', 81 | `title` varchar(255) NOT NULL, 82 | `remark` text NOT NULL, 83 | `level` int(4) NOT NULL DEFAULT '0', 84 | `state` int(4) NOT NULL, 85 | `created` datetime NOT NULL, 86 | PRIMARY KEY (`id`) 87 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 88 | /*!40101 SET character_set_client = @saved_cs_client */; 89 | 90 | -- 91 | -- Table structure for table `product` 92 | -- 93 | 94 | DROP TABLE IF EXISTS `product`; 95 | /*!40101 SET @saved_cs_client = @@character_set_client */; 96 | /*!40101 SET character_set_client = utf8 */; 97 | CREATE TABLE `product` ( 98 | `id` int(10) NOT NULL AUTO_INCREMENT, 99 | `product_type` int(10) DEFAULT '0', 100 | `code` varchar(255) DEFAULT NULL, 101 | `name` varchar(255) NOT NULL, 102 | `remark` text, 103 | `main_ver` varchar(255) NOT NULL, 104 | `source_uri` varchar(500) DEFAULT NULL, 105 | `open_api_uri` varchar(500) DEFAULT NULL, 106 | `creator_id` bigint(20) unsigned DEFAULT '0', 107 | `last_editor_id` bigint(20) unsigned DEFAULT '0', 108 | `level` int(10) DEFAULT '0', 109 | `state` int(10) DEFAULT '0', 110 | `last_updated` datetime DEFAULT NULL, 111 | `created` datetime NOT NULL, 112 | PRIMARY KEY (`id`), 113 | UNIQUE KEY `id_UNIQUE` (`id`) 114 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 115 | /*!40101 SET character_set_client = @saved_cs_client */; 116 | 117 | -- 118 | -- Table structure for table `product_feature` 119 | -- 120 | 121 | DROP TABLE IF EXISTS `product_feature`; 122 | /*!40101 SET @saved_cs_client = @@character_set_client */; 123 | /*!40101 SET character_set_client = utf8 */; 124 | CREATE TABLE `product_feature` ( 125 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 126 | `product_id` bigint(20) unsigned DEFAULT '0', 127 | `module_id` bigint(20) unsigned DEFAULT '0', 128 | `creator_id` bigint(20) unsigned DEFAULT '0', 129 | `last_editor_id` bigint(20) unsigned DEFAULT '0', 130 | `title` varchar(255) NOT NULL, 131 | `remark` text, 132 | `level` int(10) DEFAULT '0', 133 | `state` int(10) DEFAULT '0', 134 | `last_updated` datetime DEFAULT NULL, 135 | `created` datetime NOT NULL, 136 | PRIMARY KEY (`id`), 137 | UNIQUE KEY `id_UNIQUE` (`id`) 138 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 139 | /*!40101 SET character_set_client = @saved_cs_client */; 140 | 141 | -- 142 | -- Table structure for table `product_module` 143 | -- 144 | 145 | DROP TABLE IF EXISTS `product_module`; 146 | /*!40101 SET @saved_cs_client = @@character_set_client */; 147 | /*!40101 SET character_set_client = utf8 */; 148 | CREATE TABLE `product_module` ( 149 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 150 | `module_code` varchar(255) DEFAULT NULL, 151 | `creator_id` bigint(20) unsigned DEFAULT '0', 152 | `last_editor_id` bigint(20) unsigned DEFAULT '0', 153 | `version_id` bigint(20) unsigned DEFAULT '0', 154 | `parent_id` bigint(20) unsigned DEFAULT '0', 155 | `product_id` bigint(20) unsigned DEFAULT '0', 156 | `title` varchar(255) NOT NULL, 157 | `remark` text, 158 | `level` int(10) DEFAULT '0', 159 | `state` int(10) DEFAULT '0', 160 | `last_updated` datetime DEFAULT NULL, 161 | `created` datetime NOT NULL, 162 | PRIMARY KEY (`id`), 163 | UNIQUE KEY `id_UNIQUE` (`id`) 164 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 165 | /*!40101 SET character_set_client = @saved_cs_client */; 166 | 167 | -- 168 | -- Table structure for table `roadmap` 169 | -- 170 | 171 | DROP TABLE IF EXISTS `roadmap`; 172 | /*!40101 SET @saved_cs_client = @@character_set_client */; 173 | /*!40101 SET character_set_client = utf8 */; 174 | CREATE TABLE `roadmap` ( 175 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 176 | `project_id` bigint(20) unsigned NOT NULL, 177 | `deadline` datetime DEFAULT NULL, 178 | `title` varchar(255) NOT NULL, 179 | `remark` text, 180 | `state` int(3) DEFAULT '0', 181 | `finish_date` datetime NOT NULL, 182 | PRIMARY KEY (`id`) 183 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 184 | /*!40101 SET character_set_client = @saved_cs_client */; 185 | 186 | -- 187 | -- Table structure for table `usecase` 188 | -- 189 | 190 | DROP TABLE IF EXISTS `usecase`; 191 | /*!40101 SET @saved_cs_client = @@character_set_client */; 192 | /*!40101 SET character_set_client = utf8 */; 193 | CREATE TABLE `usecase` ( 194 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 195 | `product_id` bigint(20) unsigned NOT NULL DEFAULT '0', 196 | `module_id` bigint(20) NOT NULL, 197 | `creator_id` bigint(20) unsigned NOT NULL, 198 | `last_editor_id` bigint(20) NOT NULL DEFAULT '0', 199 | `test_path` varchar(255) DEFAULT NULL, 200 | `remark` text, 201 | `paramas` text, 202 | `expected_results` text NOT NULL, 203 | `tested_results` text NOT NULL, 204 | `quality_pass` bit(1) NOT NULL DEFAULT b'0', 205 | `state` int(4) NOT NULL DEFAULT '0', 206 | `created` datetime NOT NULL, 207 | PRIMARY KEY (`id`) 208 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 209 | /*!40101 SET character_set_client = @saved_cs_client */; 210 | 211 | -- 212 | -- Table structure for table `user` 213 | -- 214 | 215 | DROP TABLE IF EXISTS `user`; 216 | /*!40101 SET @saved_cs_client = @@character_set_client */; 217 | /*!40101 SET character_set_client = utf8 */; 218 | CREATE TABLE `user` ( 219 | `id` int(20) unsigned NOT NULL, 220 | `mobile_no` varchar(25) DEFAULT NULL, 221 | `wx_uuid` varchar(50) DEFAULT NULL, 222 | `wx_name` varchar(50) DEFAULT NULL, 223 | `wx_avata_url` varchar(100) DEFAULT NULL, 224 | `nick_name` varchar(255) NOT NULL, 225 | `real_name` varchar(255) DEFAULT NULL, 226 | `title` varchar(255) DEFAULT NULL, 227 | `pwd` varchar(100) NOT NULL, 228 | `work_groups` varchar(255) DEFAULT NULL, 229 | `roles` varchar(255) DEFAULT NULL, 230 | `employee_no` varchar(255) DEFAULT NULL, 231 | `email` varchar(255) DEFAULT NULL, 232 | `is_banned` bit(1) DEFAULT b'0', 233 | `last_login_date` datetime DEFAULT NULL, 234 | `last_session_id` varchar(100) DEFAULT NULL, 235 | `last_login_ip` varchar(50) DEFAULT NULL, 236 | `created` datetime NOT NULL, 237 | PRIMARY KEY (`id`), 238 | UNIQUE KEY `id_UNIQUE` (`id`) 239 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 240 | /*!40101 SET character_set_client = @saved_cs_client */; 241 | 242 | -- 243 | -- Table structure for table `user_group` 244 | -- 245 | 246 | DROP TABLE IF EXISTS `user_group`; 247 | /*!40101 SET @saved_cs_client = @@character_set_client */; 248 | /*!40101 SET character_set_client = utf8 */; 249 | CREATE TABLE `user_group` ( 250 | `group_name` varchar(255) NOT NULL, 251 | `users` varchar(255) DEFAULT NULL, 252 | `creator_id` bigint(20) DEFAULT '0', 253 | `created` datetime NOT NULL, 254 | PRIMARY KEY (`group_name`), 255 | UNIQUE KEY `id_UNIQUE` (`group_name`) 256 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 257 | /*!40101 SET character_set_client = @saved_cs_client */; 258 | 259 | -- 260 | -- Table structure for table `work_task` 261 | -- 262 | 263 | DROP TABLE IF EXISTS `work_task`; 264 | /*!40101 SET @saved_cs_client = @@character_set_client */; 265 | /*!40101 SET character_set_client = utf8 */; 266 | CREATE TABLE `work_task` ( 267 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 268 | `workunit_id` bigint(20) unsigned NOT NULL DEFAULT '0', 269 | `creator_id` bigint(20) unsigned NOT NULL DEFAULT '0', 270 | `executor_id` bigint(20) NOT NULL DEFAULT '0', 271 | `task_type` int(4) NOT NULL DEFAULT '0', 272 | `title` varchar(255) NOT NULL, 273 | `confirm_state` int(4) NOT NULL DEFAULT '0', 274 | `review_state` int(4) NOT NULL, 275 | `confirm_by_id` bigint(20) unsigned NOT NULL DEFAULT '0', 276 | `review_by_id` bigint(20) NOT NULL, 277 | `level` int(4) NOT NULL DEFAULT '0', 278 | `state` int(4) NOT NULL DEFAULT '0', 279 | `close_time` datetime DEFAULT NULL, 280 | `confirm_time` datetime DEFAULT NULL, 281 | `review_time` datetime DEFAULT NULL, 282 | `created` datetime NOT NULL, 283 | PRIMARY KEY (`id`) 284 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 285 | /*!40101 SET character_set_client = @saved_cs_client */; 286 | 287 | -- 288 | -- Table structure for table `work_unit` 289 | -- 290 | 291 | DROP TABLE IF EXISTS `work_unit`; 292 | /*!40101 SET @saved_cs_client = @@character_set_client */; 293 | /*!40101 SET character_set_client = utf8 */; 294 | CREATE TABLE `work_unit` ( 295 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 296 | `project_id` bigint(20) NOT NULL DEFAULT '0', 297 | `parent_id` bigint(20) NOT NULL DEFAULT '0', 298 | `product_id` bigint(20) unsigned NOT NULL DEFAULT '0', 299 | `version_id` bigint(20) NOT NULL, 300 | `module_id` bigint(20) NOT NULL, 301 | `creator_id` bigint(20) unsigned NOT NULL DEFAULT '0', 302 | `executor_id` bigint(20) NOT NULL DEFAULT '0', 303 | `members` varchar(255) NOT NULL, 304 | `title` varchar(255) NOT NULL, 305 | `start_date` datetime DEFAULT NULL, 306 | `finish_date` datetime DEFAULT NULL, 307 | `level` int(4) NOT NULL DEFAULT '0', 308 | `state` int(4) NOT NULL DEFAULT '0', 309 | `created` datetime NOT NULL, 310 | PRIMARY KEY (`id`) 311 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 312 | /*!40101 SET character_set_client = @saved_cs_client */; 313 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 314 | 315 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 316 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 317 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 318 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 319 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 320 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 321 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 322 | 323 | -- Dump completed on 2020-09-27 17:20:55 324 | -------------------------------------------------------------------------------- /GoGoGo.DataStorage/DataRepoBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using MySql.Data.MySqlClient; 4 | using System.Linq; 5 | using Dapper; 6 | using Dapper.Contrib; 7 | using Dapper.Contrib.Extensions; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.Data.SqlClient; 11 | 12 | namespace GoGoGo.DataStorage 13 | { 14 | /* 15 | Copyright (C) 2019 Jiang Ming Feng 16 | Github: https://github.com/mfjiang 17 | Contact: hamlet.jiang@live.com 18 | License: https://github.com/mfjiang/GoGoGo/blob/master/LICENSE 19 | 20 | 这一程序库是自由软件,您可以遵照自由软件基金会出版的 GNU General Public License (以下简称 GNU GPL v3)条款来修改和重新发布这一程序库,或者用许可证的第二版,或者 (根据您的选择) 用任何更新的版本。 21 | 22 | 发布这一程序库的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 GNU GPL v3条款。 23 | 您应该已经和程序库一起收到一份 GNU GPL v3内容的副本。如果还没有,写信给: 24 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | This library is free software, you can modify and republish this program in accordance with the terms of the GNU Lesser General Public License published by the Free Software Foundation, or use the second version of the license, or (depending on your choice) Use any updated version. 27 | 28 | The purpose of publishing this library is to make it useful, but without any guarantee. There are no guarantees that are implied for a specific purpose. For more details, please refer to the GNU Lesser General Public License. 29 | 30 | You should have received a copy of the GNU Lesser General Public License along with the library. If not, write to: 31 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | */ 33 | 34 | public class DataRepoBase where TEntity : class 35 | { 36 | #region private fileds 37 | private string m_ConnStr = String.Empty; 38 | private IDbConnection m_MysqlConn = null; 39 | #endregion 40 | 41 | public IDbConnection Conn { get { return m_MysqlConn; } } 42 | 43 | public DataRepoBase(string connStr) 44 | { 45 | m_ConnStr = connStr; 46 | //just for test 47 | //m_MysqlConn = new MySqlConnection(connStr); 48 | //m_MysqlConn.Open(); 49 | //m_MysqlConn.Close(); 50 | 51 | SqlMapperExtensions.TableNameMapper = (IUser)=>{ 52 | return "user"; 53 | }; 54 | 55 | } 56 | 57 | public virtual ulong Insert(TEntity entity) 58 | { 59 | ulong r = 0; 60 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 61 | { 62 | 63 | m_MysqlConn.Open(); 64 | r = (ulong)m_MysqlConn.Insert(entity); 65 | m_MysqlConn.Close(); 66 | } 67 | return r; 68 | } 69 | 70 | public virtual TEntity Get(object id) 71 | { 72 | TEntity r = null; 73 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 74 | { 75 | m_MysqlConn.Open(); 76 | r = m_MysqlConn.Get(id); 77 | m_MysqlConn.Close(); 78 | } 79 | return r; 80 | } 81 | 82 | public virtual bool Exists(object key, string tableName, string keyName) 83 | { 84 | long r = 0; 85 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 86 | { 87 | m_MysqlConn.Open(); 88 | string sql = String.Format("select count(*) as total from `{0}` where `{1}`=@{2}", tableName, keyName, key); 89 | MySqlParameter p1 = new MySqlParameter("@" + key, key); 90 | MySqlParameter[] parameters = new MySqlParameter[] { p1 }; 91 | r = m_MysqlConn.ExecuteScalar(sql, parameters); 92 | m_MysqlConn.Close(); 93 | } 94 | return r > 0; 95 | } 96 | 97 | public virtual long Count(string tableName, string sqlWhere, params MySqlParameter[] parameters) 98 | { 99 | long r = 0; 100 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 101 | { 102 | m_MysqlConn.Open(); 103 | string sql = String.Format("select count(*) as total from `{0}` where {1}", tableName, sqlWhere); 104 | r = m_MysqlConn.ExecuteScalar(sql, parameters); 105 | m_MysqlConn.Close(); 106 | } 107 | return r; 108 | } 109 | 110 | public virtual TEntity QuerySingle(CommandDefinition cmd) 111 | { 112 | TEntity r = null; 113 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 114 | { 115 | m_MysqlConn.Open(); 116 | r = m_MysqlConn.QuerySingleOrDefault(cmd); 117 | m_MysqlConn.Close(); 118 | } 119 | return r; 120 | } 121 | 122 | public virtual IEnumerable Query(CommandDefinition cmd) 123 | { 124 | IEnumerable r = null; 125 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 126 | { 127 | m_MysqlConn.Open(); 128 | r = m_MysqlConn.Query(cmd); 129 | m_MysqlConn.Close(); 130 | } 131 | return r; 132 | } 133 | 134 | public virtual bool Update(TEntity entity) 135 | { 136 | bool r = false; 137 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 138 | { 139 | m_MysqlConn.Open(); 140 | r = m_MysqlConn.Update(entity); 141 | m_MysqlConn.Close(); 142 | } 143 | return r; 144 | } 145 | 146 | /// 147 | /// get data page 148 | /// 149 | /// sql command,without 'where' 150 | /// order command,without 'order by' 151 | /// fields,'*' as default 152 | /// page size 153 | /// page number 154 | /// 155 | public virtual DataSet GetDataPage(string sqlQuery, string orderBy, string tableName, int pageSize = 10, int pageNo = 1, string fields = "*") 156 | { 157 | //IN p_table_name VARCHAR(1024), /*表名*/ 158 | //IN p_fields VARCHAR(1024), /*查询字段*/ 159 | //IN p_page_size INT, /*每页记录数*/ 160 | //IN p_page_now INT, /*当前页*/ 161 | //IN p_order_string VARCHAR(128), /*排序条件(包含ORDER关键字,可为空)*/ 162 | //IN p_where_string VARCHAR(1024), /*WHERE条件(包含WHERE关键字,可为空)*/ 163 | //OUT p_out_rows INT 164 | 165 | var p1 = new MySqlParameter("@p_table_name", tableName) 166 | { 167 | Direction = ParameterDirection.Input 168 | }; 169 | 170 | var p2 = new MySqlParameter("@p_fields", string.IsNullOrWhiteSpace(fields) ? "*" : fields) 171 | { 172 | Direction = ParameterDirection.Input 173 | }; 174 | 175 | var p3 = new MySqlParameter("@p_page_size", pageSize) 176 | { 177 | Direction = ParameterDirection.Input 178 | }; 179 | 180 | var p4 = new MySqlParameter("@p_page_now", pageNo) 181 | { 182 | Direction = ParameterDirection.Input 183 | }; 184 | 185 | var p5 = new MySqlParameter("@p_order_string", string.IsNullOrWhiteSpace(orderBy) ? "" : " order by " + orderBy) 186 | { 187 | Direction = ParameterDirection.Input 188 | }; 189 | 190 | var p6 = new MySqlParameter("@p_where_string", string.IsNullOrWhiteSpace(sqlQuery) ? "" : " where " + sqlQuery) 191 | { 192 | Direction = ParameterDirection.Input 193 | }; 194 | 195 | MySqlParameter[] parameters = new MySqlParameter[] 196 | { 197 | p1,p2,p3,p4,p5,p6 198 | }; 199 | DataSet ds = null; 200 | 201 | if (parameters.Length > 0) 202 | { 203 | string sql = 204 | $"call get_data_pager({"@p_table_name"},{"@p_fields"},{"@p_page_size"},{"@p_page_now"},{"@p_order_string"},{"@p_where_string"})"; 205 | using (MySqlConnection conn =new MySqlConnection(m_ConnStr)) 206 | { 207 | if (conn.State == ConnectionState.Closed) 208 | { 209 | conn.Open(); 210 | } 211 | ds = MySqlHelper.ExecuteDataset(conn, sql, parameters); 212 | conn.Close(); 213 | } 214 | } 215 | return ds; 216 | } 217 | 218 | /// 219 | /// convert data table to a dictionary list 220 | /// 221 | /// data table 222 | /// 223 | public virtual List> TableToList(DataTable dt) 224 | { 225 | List> list = new List>(); 226 | 227 | if (dt != null) 228 | { 229 | foreach (DataRow dr in dt.Rows) 230 | { 231 | list.Add(RowToDictionary(dr)); 232 | } 233 | } 234 | 235 | return list; 236 | } 237 | 238 | /// 239 | /// convert data row to a dictionary 240 | /// 241 | /// data row 242 | /// 243 | public virtual Dictionary RowToDictionary(DataRow row) 244 | { 245 | Dictionary dic = new Dictionary(); 246 | DataTable temp = row.Table; 247 | for (int i = 0; i < temp.Columns.Count; i++) 248 | { 249 | dic.Add(temp.Columns[i].ColumnName, row[i]); 250 | } 251 | 252 | return dic; 253 | } 254 | 255 | /// 256 | /// convert a dictionary to an entity 257 | /// 258 | /// entity class 259 | /// data dictionary 260 | /// 261 | public virtual T DicToObject(Dictionary dic) where T : new() 262 | { 263 | var md = new T(); 264 | foreach (var d in dic) 265 | { 266 | var filed = d.Key; 267 | var value = d.Value; 268 | var pinfo = md.GetType().GetProperty(filed); 269 | if (pinfo != null && value != null && !value.GetType().Equals(typeof(DBNull))) 270 | { 271 | if (pinfo.PropertyType.Equals(typeof(Boolean))) 272 | { 273 | if (int.Parse(d.Value.ToString()) == 0) 274 | { 275 | value = false; 276 | } 277 | else 278 | { 279 | value = true; 280 | } 281 | } 282 | 283 | if (pinfo.PropertyType.Equals(typeof(DateTime?))) 284 | { 285 | DateTime dateTime; 286 | if (DateTime.TryParse(d.Value.ToString(), out dateTime)) 287 | { 288 | value = dateTime; 289 | } 290 | else 291 | { 292 | value = null; 293 | } 294 | } 295 | 296 | pinfo.SetValue(md, value); 297 | 298 | } 299 | } 300 | return md; 301 | } 302 | 303 | /// 304 | /// convert a data row to an entity 305 | /// 306 | /// entity class 307 | /// data row 308 | /// 309 | public virtual T RowToEntity(DataRow row) where T : new() 310 | { 311 | T entity = default(T); 312 | if (row != null) 313 | { 314 | try 315 | { 316 | Dictionary dic = RowToDictionary(row); 317 | entity = DicToObject(dic); 318 | } 319 | catch (Exception ex) 320 | { 321 | throw new Exception("convert to dictionary format failed", ex); 322 | } 323 | } 324 | return entity; 325 | } 326 | 327 | public virtual bool Delete(TEntity entity) 328 | { 329 | bool r = false; 330 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 331 | { 332 | m_MysqlConn.Open(); 333 | r = m_MysqlConn.Delete(entity); 334 | m_MysqlConn.Close(); 335 | } 336 | return r; 337 | } 338 | 339 | public virtual bool Delete(string tableName, string keyName, ulong key) 340 | { 341 | bool r = false; 342 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 343 | { 344 | m_MysqlConn.Open(); 345 | string sql = $"delete from {tableName} where `{keyName}` = {key}"; 346 | r = m_MysqlConn.Execute(sql) > 0; 347 | m_MysqlConn.Close(); 348 | } 349 | return r; 350 | } 351 | 352 | public virtual bool Delete(string tableName, string keyName, uint key) 353 | { 354 | bool r = false; 355 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 356 | { 357 | m_MysqlConn.Open(); 358 | string sql = $"delete from {tableName} where `{keyName}` = {key}"; 359 | r = m_MysqlConn.Execute(sql) > 0; 360 | m_MysqlConn.Close(); 361 | } 362 | return r; 363 | } 364 | 365 | public virtual bool Delete(string tableName, string keyName, long key) 366 | { 367 | bool r = false; 368 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 369 | { 370 | m_MysqlConn.Open(); 371 | string sql = $"delete from {tableName} where `{keyName}` = {key}"; 372 | r = m_MysqlConn.Execute(sql) > 0; 373 | m_MysqlConn.Close(); 374 | } 375 | return r; 376 | } 377 | 378 | public virtual bool Delete(string tableName, string keyName, Int32 key) 379 | { 380 | bool r = false; 381 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 382 | { 383 | m_MysqlConn.Open(); 384 | string sql = $"delete from {tableName} where `{keyName}` = {key}"; 385 | r = m_MysqlConn.Execute(sql) > 0; 386 | m_MysqlConn.Close(); 387 | } 388 | return r; 389 | } 390 | 391 | public virtual bool Delete(string tableName, string keyName, string key) 392 | { 393 | bool r = false; 394 | using (m_MysqlConn = new MySqlConnection(m_ConnStr)) 395 | { 396 | m_MysqlConn.Open(); 397 | string sql = $"delete from {tableName} where `{keyName}` = '{key}'"; 398 | r = m_MysqlConn.Execute(sql) > 0; 399 | m_MysqlConn.Close(); 400 | } 401 | return r; 402 | } 403 | } 404 | } 405 | --------------------------------------------------------------------------------