Browse Source

Merge pull request #8 from vran-dev/feature/vran

feature: support remark CRUD
master
vran 3 years ago
committed by GitHub
parent
commit
4c74db8ba2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 60
      api/src/main/java/com/databasir/api/DocumentRemarkController.java
  2. 9
      api/src/main/java/com/databasir/api/Routes.java
  3. 2
      api/src/main/resources/application-local.properties
  4. BIN
      api/src/main/resources/static/.DS_Store
  5. 0
      api/src/main/resources/static/css/app.56c172b4.css
  6. 0
      api/src/main/resources/static/css/chunk-1b2e2587.a5b9f9ad.css
  7. 1
      api/src/main/resources/static/css/chunk-3bf24d18.e722c805.css
  8. 1
      api/src/main/resources/static/css/chunk-4869e91c.2c96d4cb.css
  9. 0
      api/src/main/resources/static/css/chunk-7efe8be4.a5cbc9e6.css
  10. 0
      api/src/main/resources/static/css/chunk-bf93911a.ab54ac4c.css
  11. 2
      api/src/main/resources/static/index.html
  12. 4
      api/src/main/resources/static/js/app.cf623e0d.js
  13. 2
      api/src/main/resources/static/js/app.cf623e0d.js.map
  14. 2
      api/src/main/resources/static/js/chunk-0e34b2c6.7af33675.js
  15. 1
      api/src/main/resources/static/js/chunk-0e34b2c6.7af33675.js.map
  16. 2
      api/src/main/resources/static/js/chunk-1b2e2587.2a26d5cb.js
  17. 1
      api/src/main/resources/static/js/chunk-1b2e2587.2a26d5cb.js.map
  18. 1
      api/src/main/resources/static/js/chunk-2d0cc811.c5d1ef9e.js.map
  19. 2
      api/src/main/resources/static/js/chunk-2d0cc811.feb081c8.js
  20. 1
      api/src/main/resources/static/js/chunk-2d0cc811.feb081c8.js.map
  21. 2
      api/src/main/resources/static/js/chunk-3bf24d18.e5da42ea.js
  22. 1
      api/src/main/resources/static/js/chunk-3bf24d18.e5da42ea.js.map
  23. 2
      api/src/main/resources/static/js/chunk-4869e91c.ee78c2e2.js
  24. 1
      api/src/main/resources/static/js/chunk-4869e91c.ee78c2e2.js.map
  25. 1
      api/src/main/resources/static/js/chunk-48cebeac.162363c9.js.map
  26. 2
      api/src/main/resources/static/js/chunk-48cebeac.b43a95b4.js
  27. 1
      api/src/main/resources/static/js/chunk-48cebeac.b43a95b4.js.map
  28. 1
      api/src/main/resources/static/js/chunk-7efe8be4.815f1aa1.js.map
  29. 2
      api/src/main/resources/static/js/chunk-7efe8be4.e8bbd745.js
  30. 1
      api/src/main/resources/static/js/chunk-7efe8be4.e8bbd745.js.map
  31. 2
      api/src/main/resources/static/js/chunk-9622a6d8.c20b1f79.js
  32. 1
      api/src/main/resources/static/js/chunk-9622a6d8.c20b1f79.js.map
  33. 1
      api/src/main/resources/static/js/chunk-9622a6d8.d116da54.js.map
  34. 1
      api/src/main/resources/static/js/chunk-abb10c56.2eac1d1a.js.map
  35. 2
      api/src/main/resources/static/js/chunk-abb10c56.4c323350.js
  36. 1
      api/src/main/resources/static/js/chunk-abb10c56.4c323350.js.map
  37. 2
      api/src/main/resources/static/js/chunk-bf93911a.d40185ff.js
  38. 1
      api/src/main/resources/static/js/chunk-bf93911a.d40185ff.js.map
  39. 1
      api/src/main/resources/static/js/chunk-bf93911a.ed8cd50e.js.map
  40. 1
      api/src/main/resources/static/js/chunk-fffb1b64.1ffb9f27.js.map
  41. 2
      api/src/main/resources/static/js/chunk-fffb1b64.df1e960f.js
  42. 1
      api/src/main/resources/static/js/chunk-fffb1b64.df1e960f.js.map
  43. 1
      api/src/main/resources/static/js/chunk-vendors.42fcab1c.js.map
  44. 6
      api/src/main/resources/static/js/chunk-vendors.ebe2dc88.js
  45. 1
      api/src/main/resources/static/js/chunk-vendors.ebe2dc88.js.map
  46. 19
      core/src/main/java/com/databasir/core/domain/remark/converter/RemarkResponseConverter.java
  47. 18
      core/src/main/java/com/databasir/core/domain/remark/data/RemarkCreateRequest.java
  48. 35
      core/src/main/java/com/databasir/core/domain/remark/data/RemarkListCondition.java
  49. 30
      core/src/main/java/com/databasir/core/domain/remark/data/RemarkResponse.java
  50. 81
      core/src/main/java/com/databasir/core/domain/remark/service/DocumentRemarkService.java
  51. 2
      core/src/main/java/com/databasir/core/domain/system/service/SystemService.java
  52. 7
      dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java
  53. 2
      dao/generated-src/jooq/main/java/com/databasir/dao/Indexes.java
  54. 3
      dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java
  55. 6
      dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java
  56. 176
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/DocumentRemark.java
  57. 170
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DocumentRemarkPojo.java
  58. 349
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DocumentRemarkRecord.java
  59. 32
      dao/src/main/java/com/databasir/dao/impl/DocumentRemarkDao.java
  60. 2
      dao/src/main/java/com/databasir/dao/impl/UserDao.java
  61. 13
      dao/src/main/resources/db/migration/V1__init.sql

60
api/src/main/java/com/databasir/api/DocumentRemarkController.java

@ -0,0 +1,60 @@
package com.databasir.api;
import com.databasir.api.config.security.DatabasirUserDetails;
import com.databasir.common.JsonData;
import com.databasir.core.domain.remark.data.RemarkCreateRequest;
import com.databasir.core.domain.remark.data.RemarkListCondition;
import com.databasir.core.domain.remark.data.RemarkResponse;
import com.databasir.core.domain.remark.service.DocumentRemarkService;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@RestController
@Validated
@RequiredArgsConstructor
public class DocumentRemarkController {
private final DocumentRemarkService documentRemarkService;
@GetMapping(Routes.DocumentRemark.LIST)
public JsonData<Page<RemarkResponse>> listByProjectId(@PathVariable Integer groupId,
@PathVariable Integer projectId,
@PageableDefault(sort = "id",
direction = Sort.Direction.DESC)
Pageable request,
RemarkListCondition condition) {
var data = documentRemarkService.list(groupId, projectId, request, condition);
return JsonData.ok(data);
}
@DeleteMapping(Routes.DocumentRemark.DELETE)
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId)")
public JsonData<Void> delete(@PathVariable Integer groupId,
@PathVariable Integer projectId,
@PathVariable Integer remarkId) {
documentRemarkService.deleteById(groupId, projectId, remarkId);
return JsonData.ok();
}
@PostMapping(Routes.DocumentRemark.CREATE)
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId, 'GROUP_MEMBER?groupId='+#groupId)")
public JsonData<Void> create(@PathVariable Integer groupId,
@PathVariable Integer projectId,
@RequestBody @Valid RemarkCreateRequest request) {
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
.getAuthentication()
.getPrincipal();
Integer userId = principal.getUserPojo().getId();
documentRemarkService.create(groupId, projectId, userId, request);
return JsonData.ok();
}
}

9
api/src/main/java/com/databasir/api/Routes.java

@ -70,6 +70,15 @@ public interface Routes {
String LIST_VERSIONS = BASE + "/projects/{projectId}/document_versions"; String LIST_VERSIONS = BASE + "/projects/{projectId}/document_versions";
} }
interface DocumentRemark {
String LIST = BASE + "/groups/{groupId}/projects/{projectId}/remarks";
String CREATE = BASE + "/groups/{groupId}/projects/{projectId}/remarks";
String DELETE = BASE + "/groups/{groupId}/projects/{projectId}/remarks/{remarkId}";
}
interface Setting { interface Setting {
String GET_SYS_EMAIL = BASE + "/settings/sys_email"; String GET_SYS_EMAIL = BASE + "/settings/sys_email";

2
api/src/main/resources/application-local.properties

@ -6,6 +6,6 @@ spring.datasource.password=123456
spring.datasource.url=jdbc:mysql://localhost:3306/databasir spring.datasource.url=jdbc:mysql://localhost:3306/databasir
spring.jooq.sql-dialect=mysql spring.jooq.sql-dialect=mysql
spring.flyway.enabled=true spring.flyway.enabled=false
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true
spring.flyway.locations=classpath:db/migration spring.flyway.locations=classpath:db/migration

BIN
api/src/main/resources/static/.DS_Store

Binary file not shown.

0
api/src/main/resources/static/css/app.ab408f82.css → api/src/main/resources/static/css/app.56c172b4.css

0
api/src/main/resources/static/css/chunk-0e34b2c6.06814884.css → api/src/main/resources/static/css/chunk-1b2e2587.a5b9f9ad.css

1
api/src/main/resources/static/css/chunk-3bf24d18.e722c805.css

@ -0,0 +1 @@
.remark-card{margin-bottom:30px}.remark-header{display:flex;justify-content:space-between;align-items:center}.remark-header .remark-user{color:#6d6d6d}.remark-header .remark-time{color:#6d6d6d;font-size:.8rem;margin-left:10px}.remark-content{white-space:pre-wrap;text-align:left}.text{font-size:14px;line-height:1.3rem}.item{margin-top:10px;margin-right:40px}.toc-wrapper{right:0;top:60;z-index:0;bottom:auto;padding-left:33px;margin-left:10px}.toc{top:130px;margin-left:0;transform:scale(1);bottom:0;position:fixed;overflow-y:hidden;overflow-x:hidden}.toc:hover{overflow-y:auto}.toc-wrapper .toc ul{list-style:none;line-height:1.7;inline-size:200px;overflow-wrap:break-word}.toc-wrapper .toc a{display:inherit}.document-content-wrapper{display:flex;margin:0;min-width:50rem;max-width:60rem}.document-content{min-width:50rem}

1
api/src/main/resources/static/css/chunk-4869e91c.2c96d4cb.css

@ -1 +0,0 @@
.toc-wrapper{right:0;top:60;z-index:0;bottom:auto;padding-left:60px;margin-left:10px}.toc{top:130px;margin-left:0;transform:scale(1);bottom:0;position:fixed;overflow-y:hidden;overflow-x:hidden}.toc:hover{overflow-y:auto}.toc-wrapper .toc ul{list-style:none;line-height:1.7}.document-content-wrapper{display:flex;margin:0;min-width:50rem}.document-content{min-width:50rem}

0
api/src/main/resources/static/css/chunk-7efe8be4.00ac37b1.css → api/src/main/resources/static/css/chunk-7efe8be4.a5cbc9e6.css

0
api/src/main/resources/static/css/chunk-bf93911a.e51aa148.css → api/src/main/resources/static/css/chunk-bf93911a.ab54ac4c.css

2
api/src/main/resources/static/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><link href="/css/chunk-0e34b2c6.06814884.css" rel="prefetch"><link href="/css/chunk-4869e91c.2c96d4cb.css" rel="prefetch"><link href="/css/chunk-7efe8be4.00ac37b1.css" rel="prefetch"><link href="/css/chunk-bf93911a.e51aa148.css" rel="prefetch"><link href="/js/chunk-0e34b2c6.7af33675.js" rel="prefetch"><link href="/js/chunk-2d0cc811.c5d1ef9e.js" rel="prefetch"><link href="/js/chunk-4869e91c.ee78c2e2.js" rel="prefetch"><link href="/js/chunk-48cebeac.162363c9.js" rel="prefetch"><link href="/js/chunk-7efe8be4.815f1aa1.js" rel="prefetch"><link href="/js/chunk-9622a6d8.d116da54.js" rel="prefetch"><link href="/js/chunk-abb10c56.2eac1d1a.js" rel="prefetch"><link href="/js/chunk-bf93911a.ed8cd50e.js" rel="prefetch"><link href="/js/chunk-fffb1b64.1ffb9f27.js" rel="prefetch"><link href="/css/app.ab408f82.css" rel="preload" as="style"><link href="/css/chunk-vendors.d4aa889d.css" rel="preload" as="style"><link href="/js/app.214933c9.js" rel="preload" as="script"><link href="/js/chunk-vendors.42fcab1c.js" rel="preload" as="script"><link href="/css/chunk-vendors.d4aa889d.css" rel="stylesheet"><link href="/css/app.ab408f82.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.42fcab1c.js"></script><script src="/js/app.214933c9.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><link href="/css/chunk-1b2e2587.a5b9f9ad.css" rel="prefetch"><link href="/css/chunk-3bf24d18.e722c805.css" rel="prefetch"><link href="/css/chunk-7efe8be4.a5cbc9e6.css" rel="prefetch"><link href="/css/chunk-bf93911a.ab54ac4c.css" rel="prefetch"><link href="/js/chunk-1b2e2587.2a26d5cb.js" rel="prefetch"><link href="/js/chunk-2d0cc811.feb081c8.js" rel="prefetch"><link href="/js/chunk-3bf24d18.e5da42ea.js" rel="prefetch"><link href="/js/chunk-48cebeac.b43a95b4.js" rel="prefetch"><link href="/js/chunk-7efe8be4.e8bbd745.js" rel="prefetch"><link href="/js/chunk-9622a6d8.c20b1f79.js" rel="prefetch"><link href="/js/chunk-abb10c56.4c323350.js" rel="prefetch"><link href="/js/chunk-bf93911a.d40185ff.js" rel="prefetch"><link href="/js/chunk-fffb1b64.df1e960f.js" rel="prefetch"><link href="/css/app.56c172b4.css" rel="preload" as="style"><link href="/css/chunk-vendors.d4aa889d.css" rel="preload" as="style"><link href="/js/app.cf623e0d.js" rel="preload" as="script"><link href="/js/chunk-vendors.ebe2dc88.js" rel="preload" as="script"><link href="/css/chunk-vendors.d4aa889d.css" rel="stylesheet"><link href="/css/app.56c172b4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.ebe2dc88.js"></script><script src="/js/app.cf623e0d.js"></script></body></html>

4
api/src/main/resources/static/js/app.214933c9.js → api/src/main/resources/static/js/app.cf623e0d.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.214933c9.js.map → api/src/main/resources/static/js/app.cf623e0d.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-0e34b2c6.7af33675.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-0e34b2c6.7af33675.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-1b2e2587.2a26d5cb.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-1b2e2587.2a26d5cb.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-2d0cc811.c5d1ef9e.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-2d0cc811.c5d1ef9e.js → api/src/main/resources/static/js/chunk-2d0cc811.feb081c8.js

@ -1,2 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cc811"],{"4de0":function(e,t,r){"use strict";r.r(t);var n=r("7a23"),o=Object(n["createTextVNode"])(" : "),u=Object(n["createTextVNode"])("保存");function l(e,t,r,l,a,c){var s=Object(n["resolveComponent"])("el-input"),i=Object(n["resolveComponent"])("el-form-item"),d=Object(n["resolveComponent"])("el-col"),m=Object(n["resolveComponent"])("el-button"),f=Object(n["resolveComponent"])("el-form"),p=Object(n["resolveComponent"])("el-card"),b=Object(n["resolveComponent"])("el-main"),j=Object(n["resolveComponent"])("el-container");return Object(n["openBlock"])(),Object(n["createBlock"])(j,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(b,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(p,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(f,{model:a.form,"label-position":"top",rules:a.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(i,{label:"邮箱账号",prop:"username"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.form.username=e})},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(i,{label:"邮箱密码",prop:"password"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return a.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(i,{label:"SMTP",prop:"smtpHost"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(d,{span:12},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.smtpHost,"onUpdate:modelValue":t[2]||(t[2]=function(e){return a.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(d,{span:1,style:{"text-align":"center"}},{default:Object(n["withCtx"])((function(){return[o]})),_:1}),Object(n["createVNode"])(d,{span:6},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.smtpPort,"onUpdate:modelValue":t[3]||(t[3]=function(e){return a.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),Object(n["createVNode"])(i,{style:{"margin-top":"38px"}},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(m,{type:"primary",onClick:t[4]||(t[4]=function(e){return c.onSubmit("formRef")})},{default:Object(n["withCtx"])((function(){return[u]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var a=r("1da1"),c=(r("96cf"),r("1c1e")),s="/api/v1.0/settings",i=function(){return c["a"].get(s+"/sys_email")},d=function(e){return c["a"].post(s+"/sys_email",e)},m={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i().then((function(e){return e.data}));case 2:r=t.sent,r&&(e.form=r);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(d(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))}}},f=r("6b0d"),p=r.n(f);const b=p()(m,[["render",l]]);t["default"]=b}}]); (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cc811"],{"4de0":function(e,t,r){"use strict";r.r(t);var n=r("7a23"),o=Object(n["createTextVNode"])(" : "),u=Object(n["createTextVNode"])("保存");function l(e,t,r,l,a,c){var s=Object(n["resolveComponent"])("el-input"),i=Object(n["resolveComponent"])("el-form-item"),d=Object(n["resolveComponent"])("el-col"),m=Object(n["resolveComponent"])("el-button"),f=Object(n["resolveComponent"])("el-form"),p=Object(n["resolveComponent"])("el-card"),b=Object(n["resolveComponent"])("el-main"),j=Object(n["resolveComponent"])("el-container");return Object(n["openBlock"])(),Object(n["createBlock"])(j,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(b,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(p,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(f,{model:a.form,"label-position":"top",rules:a.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(i,{label:"邮箱账号",prop:"username"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.form.username=e})},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(i,{label:"邮箱密码",prop:"password"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return a.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(i,{label:"SMTP",prop:"smtpHost"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(d,{span:12},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.smtpHost,"onUpdate:modelValue":t[2]||(t[2]=function(e){return a.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(d,{span:1,style:{"text-align":"center"}},{default:Object(n["withCtx"])((function(){return[o]})),_:1}),Object(n["createVNode"])(d,{span:6},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(s,{modelValue:a.form.smtpPort,"onUpdate:modelValue":t[3]||(t[3]=function(e){return a.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),Object(n["createVNode"])(i,{style:{"margin-top":"38px"}},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(m,{type:"primary",onClick:t[4]||(t[4]=function(e){return c.onSubmit("formRef")})},{default:Object(n["withCtx"])((function(){return[u]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var a=r("1da1"),c=(r("96cf"),r("1c1e")),s="/api/v1.0/settings",i=function(){return c["a"].get(s+"/sys_email")},d=function(e){return c["a"].post(s+"/sys_email",e)},m={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i().then((function(e){return e.data}));case 2:r=t.sent,r&&(e.form=r);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(d(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))}}},f=r("6b0d"),p=r.n(f);const b=p()(m,[["render",l]]);t["default"]=b}}]);
//# sourceMappingURL=chunk-2d0cc811.c5d1ef9e.js.map //# sourceMappingURL=chunk-2d0cc811.feb081c8.js.map

1
api/src/main/resources/static/js/chunk-2d0cc811.feb081c8.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-3bf24d18.e5da42ea.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-3bf24d18.e5da42ea.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-4869e91c.ee78c2e2.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-4869e91c.ee78c2e2.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-48cebeac.162363c9.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-48cebeac.162363c9.js → api/src/main/resources/static/js/chunk-48cebeac.b43a95b4.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-48cebeac.b43a95b4.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-7efe8be4.815f1aa1.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-7efe8be4.815f1aa1.js → api/src/main/resources/static/js/chunk-7efe8be4.e8bbd745.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-7efe8be4.e8bbd745.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-9622a6d8.d116da54.js → api/src/main/resources/static/js/chunk-9622a6d8.c20b1f79.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-9622a6d8.c20b1f79.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-9622a6d8.d116da54.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-abb10c56.2eac1d1a.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-abb10c56.2eac1d1a.js → api/src/main/resources/static/js/chunk-abb10c56.4c323350.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-abb10c56.4c323350.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-bf93911a.ed8cd50e.js → api/src/main/resources/static/js/chunk-bf93911a.d40185ff.js

@ -1,2 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bf93911a"],{"4dd4":function(e,t,n){},a1af:function(e,t,n){"use strict";n("4dd4")},a55b:function(e,t,n){"use strict";n.r(t);var r=n("7a23"),o={class:"login-card"},c=Object(r["createElementVNode"])("h1",null,"Databasir",-1),a=Object(r["createTextVNode"])(" 登录 "),u=Object(r["createTextVNode"])(" 忘记密码? ");function l(e,t,n,l,i,d){var s=Object(r["resolveComponent"])("el-header"),f=Object(r["resolveComponent"])("el-link"),b=Object(r["resolveComponent"])("el-divider"),m=Object(r["resolveComponent"])("el-form-item"),p=Object(r["resolveComponent"])("el-button"),j=Object(r["resolveComponent"])("el-space"),O=Object(r["resolveComponent"])("el-form"),h=Object(r["resolveComponent"])("el-main"),w=Object(r["resolveComponent"])("el-footer"),C=Object(r["resolveComponent"])("el-container");return Object(r["openBlock"])(),Object(r["createBlock"])(C,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(s),Object(r["createVNode"])(h,{class:"login-main"},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",o,[Object(r["createVNode"])(O,{ref:"formRef",rules:i.formRule,model:i.form,style:{border:"none"}},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(m,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(b,{"content-position":"left"},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(f,{href:"https://github.com/vran-dev/databasir",target:"_blank",underline:!1,type:"info"},{default:Object(r["withCtx"])((function(){return[c]})),_:1})]})),_:1})]})),_:1}),Object(r["createVNode"])(m,{prop:"username"},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"text",class:"login-input",placeholder:"用户名或邮箱","onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e})},null,512),[[r["vModelText"],i.form.username]])]})),_:1}),Object(r["createVNode"])(m,{prop:"password"},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"password",class:"login-input",placeholder:"密码","onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e})},null,512),[[r["vModelText"],i.form.password]])]})),_:1}),Object(r["createVNode"])(m,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(j,{size:32},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(p,{style:{width:"120px","margin-top":"10px"},color:"#000",onClick:t[2]||(t[2]=function(e){return d.onLogin("formRef")}),plain:"",round:""},{default:Object(r["withCtx"])((function(){return[a]})),_:1}),Object(r["createVNode"])(f,{href:"#",target:"_blank",underline:!1,type:"info"},{default:Object(r["withCtx"])((function(){return[u]})),_:1})]})),_:1})]})),_:1})]})),_:1},8,["rules","model"])])]})),_:1}),Object(r["createVNode"])(w,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(j)]})),_:1})]})),_:1})}var i=n("b0af"),d=n("5f87"),s={data:function(){return{form:{username:null,password:null},formRule:{username:[{required:!0,message:"请输入用户名或邮箱",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}}},methods:{toIndexPage:function(){this.$router.push({path:"/groups"})},onLogin:function(){var e=this;this.$refs.formRef.validate((function(t){t&&Object(i["a"])(e.form).then((function(t){t.errCode||(d["b"].saveUserLoginData(t.data),e.$store.commit("userUpdate",{nickname:t.data.nickname,username:t.data.username,email:t.data.email}),e.toIndexPage())}))}))}}},f=(n("a1af"),n("6b0d")),b=n.n(f);const m=b()(s,[["render",l]]);t["default"]=m}}]); (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bf93911a"],{"4dd4":function(e,t,n){},a1af:function(e,t,n){"use strict";n("4dd4")},a55b:function(e,t,n){"use strict";n.r(t);var r=n("7a23"),o={class:"login-card"},c=Object(r["createElementVNode"])("h1",null,"Databasir",-1),a=Object(r["createTextVNode"])(" 登录 "),u=Object(r["createTextVNode"])(" 忘记密码? ");function l(e,t,n,l,i,d){var s=Object(r["resolveComponent"])("el-header"),f=Object(r["resolveComponent"])("el-link"),b=Object(r["resolveComponent"])("el-divider"),m=Object(r["resolveComponent"])("el-form-item"),p=Object(r["resolveComponent"])("el-button"),j=Object(r["resolveComponent"])("el-space"),O=Object(r["resolveComponent"])("el-form"),h=Object(r["resolveComponent"])("el-main"),w=Object(r["resolveComponent"])("el-footer"),C=Object(r["resolveComponent"])("el-container");return Object(r["openBlock"])(),Object(r["createBlock"])(C,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(s),Object(r["createVNode"])(h,{class:"login-main"},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",o,[Object(r["createVNode"])(O,{ref:"formRef",rules:i.formRule,model:i.form,style:{border:"none"}},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(m,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(b,{"content-position":"left"},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(f,{href:"https://github.com/vran-dev/databasir",target:"_blank",underline:!1,type:"info"},{default:Object(r["withCtx"])((function(){return[c]})),_:1})]})),_:1})]})),_:1}),Object(r["createVNode"])(m,{prop:"username"},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"text",class:"login-input",placeholder:"用户名或邮箱","onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e})},null,512),[[r["vModelText"],i.form.username]])]})),_:1}),Object(r["createVNode"])(m,{prop:"password"},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"password",class:"login-input",placeholder:"密码","onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e})},null,512),[[r["vModelText"],i.form.password]])]})),_:1}),Object(r["createVNode"])(m,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(j,{size:32},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(p,{style:{width:"120px","margin-top":"10px"},color:"#000",onClick:t[2]||(t[2]=function(e){return d.onLogin("formRef")}),plain:"",round:""},{default:Object(r["withCtx"])((function(){return[a]})),_:1}),Object(r["createVNode"])(f,{href:"#",target:"_blank",underline:!1,type:"info"},{default:Object(r["withCtx"])((function(){return[u]})),_:1})]})),_:1})]})),_:1})]})),_:1},8,["rules","model"])])]})),_:1}),Object(r["createVNode"])(w,null,{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(j)]})),_:1})]})),_:1})}var i=n("b0af"),d=n("5f87"),s={data:function(){return{form:{username:null,password:null},formRule:{username:[{required:!0,message:"请输入用户名或邮箱",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}}},methods:{toIndexPage:function(){this.$router.push({path:"/groups"})},onLogin:function(){var e=this;this.$refs.formRef.validate((function(t){t&&Object(i["a"])(e.form).then((function(t){t.errCode||(d["b"].saveUserLoginData(t.data),e.$store.commit("userUpdate",{nickname:t.data.nickname,username:t.data.username,email:t.data.email}),e.toIndexPage())}))}))}}},f=(n("a1af"),n("6b0d")),b=n.n(f);const m=b()(s,[["render",l]]);t["default"]=m}}]);
//# sourceMappingURL=chunk-bf93911a.ed8cd50e.js.map //# sourceMappingURL=chunk-bf93911a.d40185ff.js.map

1
api/src/main/resources/static/js/chunk-bf93911a.d40185ff.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-bf93911a.ed8cd50e.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-fffb1b64.1ffb9f27.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/chunk-fffb1b64.1ffb9f27.js → api/src/main/resources/static/js/chunk-fffb1b64.df1e960f.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-fffb1b64.df1e960f.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-vendors.42fcab1c.js.map

File diff suppressed because one or more lines are too long

6
api/src/main/resources/static/js/chunk-vendors.42fcab1c.js → api/src/main/resources/static/js/chunk-vendors.ebe2dc88.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/chunk-vendors.ebe2dc88.js.map

File diff suppressed because one or more lines are too long

19
core/src/main/java/com/databasir/core/domain/remark/converter/RemarkResponseConverter.java

@ -0,0 +1,19 @@
package com.databasir.core.domain.remark.converter;
import com.databasir.core.domain.remark.data.RemarkResponse;
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
import com.databasir.dao.tables.pojos.UserPojo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@Mapper(componentModel = "spring")
public interface RemarkResponseConverter {
@Mapping(target = "remarkBy.userId", source = "remarkBy.id")
@Mapping(target = "remarkBy.nickname", source = "remarkBy.nickname")
@Mapping(target = "remarkBy.email", source = "remarkBy.email")
@Mapping(target = "id", source = "remark.id")
@Mapping(target = "createAt", source = "remark.createAt")
RemarkResponse of(DocumentRemarkPojo remark,
UserPojo remarkBy);
}

18
core/src/main/java/com/databasir/core/domain/remark/data/RemarkCreateRequest.java

@ -0,0 +1,18 @@
package com.databasir.core.domain.remark.data;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class RemarkCreateRequest {
@NotBlank
private String remark;
@NotNull
private String tableName;
private String columnName;
}

35
core/src/main/java/com/databasir/core/domain/remark/data/RemarkListCondition.java

@ -0,0 +1,35 @@
package com.databasir.core.domain.remark.data;
import com.databasir.dao.Tables;
import lombok.Data;
import org.jooq.Condition;
import org.jooq.impl.DSL;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
@Data
public class RemarkListCondition {
@NotBlank
private String tableName;
private String columnName;
public Condition toCondition(Integer projectId) {
List<Condition> conditions = new ArrayList<>();
Condition condition = Tables.DOCUMENT_REMARK.TABLE_NAME.eq(tableName);
conditions.add(condition);
Condition columnCondition;
if (columnName != null) {
columnCondition = Tables.DOCUMENT_REMARK.COLUMN_NAME.eq(columnName);
} else {
columnCondition = Tables.DOCUMENT_REMARK.COLUMN_NAME.isNull();
}
conditions.add(columnCondition);
conditions.add(Tables.DOCUMENT_REMARK.PROJECT_ID.eq(projectId));
return conditions.stream().reduce(Condition::and).orElse(DSL.trueCondition());
}
}

30
core/src/main/java/com/databasir/core/domain/remark/data/RemarkResponse.java

@ -0,0 +1,30 @@
package com.databasir.core.domain.remark.data;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class RemarkResponse {
private Integer id;
private Integer projectId;
private String remark;
private RemarkUser remarkBy;
private LocalDateTime createAt;
@Data
public static class RemarkUser {
private Integer userId;
private String nickname;
private String email;
}
}

81
core/src/main/java/com/databasir/core/domain/remark/service/DocumentRemarkService.java

@ -0,0 +1,81 @@
package com.databasir.core.domain.remark.service;
import com.databasir.common.exception.Forbidden;
import com.databasir.core.domain.remark.converter.RemarkResponseConverter;
import com.databasir.core.domain.remark.data.RemarkCreateRequest;
import com.databasir.core.domain.remark.data.RemarkListCondition;
import com.databasir.core.domain.remark.data.RemarkResponse;
import com.databasir.dao.impl.DocumentRemarkDao;
import com.databasir.dao.impl.ProjectDao;
import com.databasir.dao.impl.UserDao;
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
import com.databasir.dao.tables.pojos.UserPojo;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
public class DocumentRemarkService {
private final DocumentRemarkDao documentRemarkDao;
private final ProjectDao projectDao;
private final UserDao userDao;
private final RemarkResponseConverter remarkResponseConverter;
public void deleteById(Integer groupId,
Integer projectId,
Integer remarkId) {
if (projectDao.exists(groupId, projectId)) {
documentRemarkDao.deleteById(remarkId);
} else {
throw new Forbidden();
}
}
public Page<RemarkResponse> list(Integer groupId,
Integer projectId,
Pageable pageable,
RemarkListCondition condition) {
if (projectDao.exists(groupId, projectId)) {
Page<DocumentRemarkPojo> data = documentRemarkDao.selectByPage(pageable, condition.toCondition(projectId));
Set<Integer> userIdList = data.getContent()
.stream()
.map(DocumentRemarkPojo::getUserId)
.collect(Collectors.toSet());
Map<Integer, UserPojo> userMapById = userDao.selectUserIdIn(userIdList)
.stream()
.collect(Collectors.toMap(UserPojo::getId, Function.identity()));
return data
.map(remarkPojo -> {
UserPojo userPojo = userMapById.get(remarkPojo.getUserId());
return remarkResponseConverter.of(remarkPojo, userPojo);
});
} else {
throw new Forbidden();
}
}
public void create(Integer groupId, Integer projectId, Integer userId, RemarkCreateRequest request) {
if (projectDao.exists(groupId, projectId)) {
DocumentRemarkPojo pojo = new DocumentRemarkPojo();
pojo.setUserId(userId);
pojo.setProjectId(projectId);
pojo.setRemark(request.getRemark());
pojo.setTableName(request.getTableName());
pojo.setColumnName(request.getColumnName());
documentRemarkDao.insertAndReturnId(pojo);
} else {
throw new Forbidden();
}
}
}

2
core/src/main/java/com/databasir/core/domain/system/service/SystemService.java

@ -50,7 +50,7 @@ public class SystemService {
String email = "N/A"; String email = "N/A";
String username = "databasir"; String username = "databasir";
Optional<UserPojo> userOpt = userDao.selectByEmail(email); Optional<UserPojo> userOpt = userDao.selectByEmailOrUsername(username);
if (!userOpt.isPresent()) { if (!userOpt.isPresent()) {
UserPojo admin = new UserPojo(); UserPojo admin = new UserPojo();
admin.setEmail(email); admin.setEmail(email);

7
dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java

@ -8,6 +8,7 @@ import com.databasir.dao.tables.DataSource;
import com.databasir.dao.tables.DataSourceProperty; import com.databasir.dao.tables.DataSourceProperty;
import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseDocumentHistory; import com.databasir.dao.tables.DatabaseDocumentHistory;
import com.databasir.dao.tables.DocumentRemark;
import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login; import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.Project; import com.databasir.dao.tables.Project;
@ -62,6 +63,11 @@ public class Databasir extends SchemaImpl {
*/ */
public final DatabaseDocumentHistory DATABASE_DOCUMENT_HISTORY = DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY; public final DatabaseDocumentHistory DATABASE_DOCUMENT_HISTORY = DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY;
/**
* The table <code>databasir.document_remark</code>.
*/
public final DocumentRemark DOCUMENT_REMARK = DocumentRemark.DOCUMENT_REMARK;
/** /**
* The table <code>databasir.group</code>. * The table <code>databasir.group</code>.
*/ */
@ -142,6 +148,7 @@ public class Databasir extends SchemaImpl {
DataSourceProperty.DATA_SOURCE_PROPERTY, DataSourceProperty.DATA_SOURCE_PROPERTY,
DatabaseDocument.DATABASE_DOCUMENT, DatabaseDocument.DATABASE_DOCUMENT,
DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY,
DocumentRemark.DOCUMENT_REMARK,
Group.GROUP, Group.GROUP,
Login.LOGIN, Login.LOGIN,
Project.PROJECT, Project.PROJECT,

2
dao/generated-src/jooq/main/java/com/databasir/dao/Indexes.java

@ -6,6 +6,7 @@ package com.databasir.dao;
import com.databasir.dao.tables.DataSourceProperty; import com.databasir.dao.tables.DataSourceProperty;
import com.databasir.dao.tables.DatabaseDocumentHistory; import com.databasir.dao.tables.DatabaseDocumentHistory;
import com.databasir.dao.tables.DocumentRemark;
import com.databasir.dao.tables.TableColumnDocument; import com.databasir.dao.tables.TableColumnDocument;
import com.databasir.dao.tables.TableDocument; import com.databasir.dao.tables.TableDocument;
import com.databasir.dao.tables.TableIndexDocument; import com.databasir.dao.tables.TableIndexDocument;
@ -33,6 +34,7 @@ public class Indexes {
public static final Index TABLE_INDEX_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.DATABASE_DOCUMENT_ID }, false); public static final Index TABLE_INDEX_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.DATABASE_DOCUMENT_ID }, false); public static final Index TABLE_TRIGGER_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
public static final Index DATABASE_DOCUMENT_HISTORY_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, new OrderField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.PROJECT_ID }, false); public static final Index DATABASE_DOCUMENT_HISTORY_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, new OrderField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.PROJECT_ID }, false);
public static final Index DOCUMENT_REMARK_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DocumentRemark.DOCUMENT_REMARK, new OrderField[] { DocumentRemark.DOCUMENT_REMARK.PROJECT_ID }, false);
public static final Index TABLE_COLUMN_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableColumnDocument.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.TABLE_DOCUMENT_ID }, false); public static final Index TABLE_COLUMN_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableColumnDocument.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.TABLE_DOCUMENT_ID }, false);
public static final Index TABLE_INDEX_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.TABLE_DOCUMENT_ID }, false); public static final Index TABLE_INDEX_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.TABLE_DOCUMENT_ID }, false);
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.TABLE_DOCUMENT_ID }, false); public static final Index TABLE_TRIGGER_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.TABLE_DOCUMENT_ID }, false);

3
dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java

@ -8,6 +8,7 @@ import com.databasir.dao.tables.DataSource;
import com.databasir.dao.tables.DataSourceProperty; import com.databasir.dao.tables.DataSourceProperty;
import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseDocumentHistory; import com.databasir.dao.tables.DatabaseDocumentHistory;
import com.databasir.dao.tables.DocumentRemark;
import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login; import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.Project; import com.databasir.dao.tables.Project;
@ -24,6 +25,7 @@ import com.databasir.dao.tables.records.DataSourcePropertyRecord;
import com.databasir.dao.tables.records.DataSourceRecord; import com.databasir.dao.tables.records.DataSourceRecord;
import com.databasir.dao.tables.records.DatabaseDocumentHistoryRecord; import com.databasir.dao.tables.records.DatabaseDocumentHistoryRecord;
import com.databasir.dao.tables.records.DatabaseDocumentRecord; import com.databasir.dao.tables.records.DatabaseDocumentRecord;
import com.databasir.dao.tables.records.DocumentRemarkRecord;
import com.databasir.dao.tables.records.GroupRecord; import com.databasir.dao.tables.records.GroupRecord;
import com.databasir.dao.tables.records.LoginRecord; import com.databasir.dao.tables.records.LoginRecord;
import com.databasir.dao.tables.records.ProjectRecord; import com.databasir.dao.tables.records.ProjectRecord;
@ -61,6 +63,7 @@ public class Keys {
public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_UK_PROJECT_ID = Internal.createUniqueKey(DatabaseDocument.DATABASE_DOCUMENT, DSL.name("KEY_database_document_uk_project_id"), new TableField[] { DatabaseDocument.DATABASE_DOCUMENT.PROJECT_ID }, true); public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_UK_PROJECT_ID = Internal.createUniqueKey(DatabaseDocument.DATABASE_DOCUMENT, DSL.name("KEY_database_document_uk_project_id"), new TableField[] { DatabaseDocument.DATABASE_DOCUMENT.PROJECT_ID }, true);
public static final UniqueKey<DatabaseDocumentHistoryRecord> KEY_DATABASE_DOCUMENT_HISTORY_PRIMARY = Internal.createUniqueKey(DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DSL.name("KEY_database_document_history_PRIMARY"), new TableField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.ID }, true); public static final UniqueKey<DatabaseDocumentHistoryRecord> KEY_DATABASE_DOCUMENT_HISTORY_PRIMARY = Internal.createUniqueKey(DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DSL.name("KEY_database_document_history_PRIMARY"), new TableField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.ID }, true);
public static final UniqueKey<DatabaseDocumentHistoryRecord> KEY_DATABASE_DOCUMENT_HISTORY_UK_CONNECTION_ID_VERSION = Internal.createUniqueKey(DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DSL.name("KEY_database_document_history_uk_connection_id_version"), new TableField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.DATABASE_DOCUMENT_ID, DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.VERSION }, true); public static final UniqueKey<DatabaseDocumentHistoryRecord> KEY_DATABASE_DOCUMENT_HISTORY_UK_CONNECTION_ID_VERSION = Internal.createUniqueKey(DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DSL.name("KEY_database_document_history_uk_connection_id_version"), new TableField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.DATABASE_DOCUMENT_ID, DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.VERSION }, true);
public static final UniqueKey<DocumentRemarkRecord> KEY_DOCUMENT_REMARK_PRIMARY = Internal.createUniqueKey(DocumentRemark.DOCUMENT_REMARK, DSL.name("KEY_document_remark_PRIMARY"), new TableField[] { DocumentRemark.DOCUMENT_REMARK.ID }, true);
public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true); public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true);
public static final UniqueKey<GroupRecord> KEY_GROUP_UK_NAME = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_uk_name"), new TableField[] { Group.GROUP.NAME }, true); public static final UniqueKey<GroupRecord> KEY_GROUP_UK_NAME = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_uk_name"), new TableField[] { Group.GROUP.NAME }, true);
public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true); public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true);

6
dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java

@ -8,6 +8,7 @@ import com.databasir.dao.tables.DataSource;
import com.databasir.dao.tables.DataSourceProperty; import com.databasir.dao.tables.DataSourceProperty;
import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseDocumentHistory; import com.databasir.dao.tables.DatabaseDocumentHistory;
import com.databasir.dao.tables.DocumentRemark;
import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login; import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.Project; import com.databasir.dao.tables.Project;
@ -48,6 +49,11 @@ public class Tables {
*/ */
public static final DatabaseDocumentHistory DATABASE_DOCUMENT_HISTORY = DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY; public static final DatabaseDocumentHistory DATABASE_DOCUMENT_HISTORY = DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY;
/**
* The table <code>databasir.document_remark</code>.
*/
public static final DocumentRemark DOCUMENT_REMARK = DocumentRemark.DOCUMENT_REMARK;
/** /**
* The table <code>databasir.group</code>. * The table <code>databasir.group</code>.
*/ */

176
dao/generated-src/jooq/main/java/com/databasir/dao/tables/DocumentRemark.java

@ -0,0 +1,176 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables;
import com.databasir.dao.Databasir;
import com.databasir.dao.Indexes;
import com.databasir.dao.Keys;
import com.databasir.dao.tables.records.DocumentRemarkRecord;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row7;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentRemark extends TableImpl<DocumentRemarkRecord> {
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>databasir.document_remark</code>
*/
public static final DocumentRemark DOCUMENT_REMARK = new DocumentRemark();
/**
* The class holding records for this type
*/
@Override
public Class<DocumentRemarkRecord> getRecordType() {
return DocumentRemarkRecord.class;
}
/**
* The column <code>databasir.document_remark.id</code>.
*/
public final TableField<DocumentRemarkRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");
/**
* The column <code>databasir.document_remark.remark</code>.
*/
public final TableField<DocumentRemarkRecord, String> REMARK = createField(DSL.name("remark"), SQLDataType.CLOB.nullable(false), this, "");
/**
* The column <code>databasir.document_remark.user_id</code>. user.id
*/
public final TableField<DocumentRemarkRecord, Integer> USER_ID = createField(DSL.name("user_id"), SQLDataType.INTEGER.nullable(false), this, "user.id");
/**
* The column <code>databasir.document_remark.project_id</code>.
*/
public final TableField<DocumentRemarkRecord, Integer> PROJECT_ID = createField(DSL.name("project_id"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>databasir.document_remark.table_name</code>.
*/
public final TableField<DocumentRemarkRecord, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR(255).nullable(false), this, "");
/**
* The column <code>databasir.document_remark.column_name</code>.
*/
public final TableField<DocumentRemarkRecord, String> COLUMN_NAME = createField(DSL.name("column_name"), SQLDataType.VARCHAR(255), this, "");
/**
* The column <code>databasir.document_remark.create_at</code>.
*/
public final TableField<DocumentRemarkRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased) {
this(alias, aliased, null);
}
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
}
/**
* Create an aliased <code>databasir.document_remark</code> table reference
*/
public DocumentRemark(String alias) {
this(DSL.name(alias), DOCUMENT_REMARK);
}
/**
* Create an aliased <code>databasir.document_remark</code> table reference
*/
public DocumentRemark(Name alias) {
this(alias, DOCUMENT_REMARK);
}
/**
* Create a <code>databasir.document_remark</code> table reference
*/
public DocumentRemark() {
this(DSL.name("document_remark"), null);
}
public <O extends Record> DocumentRemark(Table<O> child, ForeignKey<O, DocumentRemarkRecord> key) {
super(child, key, DOCUMENT_REMARK);
}
@Override
public Schema getSchema() {
return aliased() ? null : Databasir.DATABASIR;
}
@Override
public List<Index> getIndexes() {
return Arrays.asList(Indexes.DOCUMENT_REMARK_IDX_PROJECT_ID);
}
@Override
public Identity<DocumentRemarkRecord, Integer> getIdentity() {
return (Identity<DocumentRemarkRecord, Integer>) super.getIdentity();
}
@Override
public UniqueKey<DocumentRemarkRecord> getPrimaryKey() {
return Keys.KEY_DOCUMENT_REMARK_PRIMARY;
}
@Override
public DocumentRemark as(String alias) {
return new DocumentRemark(DSL.name(alias), this);
}
@Override
public DocumentRemark as(Name alias) {
return new DocumentRemark(alias, this);
}
/**
* Rename this table
*/
@Override
public DocumentRemark rename(String name) {
return new DocumentRemark(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public DocumentRemark rename(Name name) {
return new DocumentRemark(name, null);
}
// -------------------------------------------------------------------------
// Row7 type methods
// -------------------------------------------------------------------------
@Override
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() {
return (Row7) super.fieldsRow();
}
}

170
dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DocumentRemarkPojo.java

@ -0,0 +1,170 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables.pojos;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentRemarkPojo implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String remark;
private Integer userId;
private Integer projectId;
private String tableName;
private String columnName;
private LocalDateTime createAt;
public DocumentRemarkPojo() {}
public DocumentRemarkPojo(DocumentRemarkPojo value) {
this.id = value.id;
this.remark = value.remark;
this.userId = value.userId;
this.projectId = value.projectId;
this.tableName = value.tableName;
this.columnName = value.columnName;
this.createAt = value.createAt;
}
public DocumentRemarkPojo(
Integer id,
String remark,
Integer userId,
Integer projectId,
String tableName,
String columnName,
LocalDateTime createAt
) {
this.id = id;
this.remark = remark;
this.userId = userId;
this.projectId = projectId;
this.tableName = tableName;
this.columnName = columnName;
this.createAt = createAt;
}
/**
* Getter for <code>databasir.document_remark.id</code>.
*/
public Integer getId() {
return this.id;
}
/**
* Setter for <code>databasir.document_remark.id</code>.
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Getter for <code>databasir.document_remark.remark</code>.
*/
public String getRemark() {
return this.remark;
}
/**
* Setter for <code>databasir.document_remark.remark</code>.
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* Getter for <code>databasir.document_remark.user_id</code>. user.id
*/
public Integer getUserId() {
return this.userId;
}
/**
* Setter for <code>databasir.document_remark.user_id</code>. user.id
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* Getter for <code>databasir.document_remark.project_id</code>.
*/
public Integer getProjectId() {
return this.projectId;
}
/**
* Setter for <code>databasir.document_remark.project_id</code>.
*/
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
/**
* Getter for <code>databasir.document_remark.table_name</code>.
*/
public String getTableName() {
return this.tableName;
}
/**
* Setter for <code>databasir.document_remark.table_name</code>.
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
* Getter for <code>databasir.document_remark.column_name</code>.
*/
public String getColumnName() {
return this.columnName;
}
/**
* Setter for <code>databasir.document_remark.column_name</code>.
*/
public void setColumnName(String columnName) {
this.columnName = columnName;
}
/**
* Getter for <code>databasir.document_remark.create_at</code>.
*/
public LocalDateTime getCreateAt() {
return this.createAt;
}
/**
* Setter for <code>databasir.document_remark.create_at</code>.
*/
public void setCreateAt(LocalDateTime createAt) {
this.createAt = createAt;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("DocumentRemarkPojo (");
sb.append(id);
sb.append(", ").append(remark);
sb.append(", ").append(userId);
sb.append(", ").append(projectId);
sb.append(", ").append(tableName);
sb.append(", ").append(columnName);
sb.append(", ").append(createAt);
sb.append(")");
return sb.toString();
}
}

349
dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DocumentRemarkRecord.java

@ -0,0 +1,349 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables.records;
import com.databasir.dao.tables.DocumentRemark;
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
import java.time.LocalDateTime;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record7;
import org.jooq.Row7;
import org.jooq.impl.UpdatableRecordImpl;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkRecord> implements Record7<Integer, String, Integer, Integer, String, String, LocalDateTime> {
private static final long serialVersionUID = 1L;
/**
* Setter for <code>databasir.document_remark.id</code>.
*/
public void setId(Integer value) {
set(0, value);
}
/**
* Getter for <code>databasir.document_remark.id</code>.
*/
public Integer getId() {
return (Integer) get(0);
}
/**
* Setter for <code>databasir.document_remark.remark</code>.
*/
public void setRemark(String value) {
set(1, value);
}
/**
* Getter for <code>databasir.document_remark.remark</code>.
*/
public String getRemark() {
return (String) get(1);
}
/**
* Setter for <code>databasir.document_remark.user_id</code>. user.id
*/
public void setUserId(Integer value) {
set(2, value);
}
/**
* Getter for <code>databasir.document_remark.user_id</code>. user.id
*/
public Integer getUserId() {
return (Integer) get(2);
}
/**
* Setter for <code>databasir.document_remark.project_id</code>.
*/
public void setProjectId(Integer value) {
set(3, value);
}
/**
* Getter for <code>databasir.document_remark.project_id</code>.
*/
public Integer getProjectId() {
return (Integer) get(3);
}
/**
* Setter for <code>databasir.document_remark.table_name</code>.
*/
public void setTableName(String value) {
set(4, value);
}
/**
* Getter for <code>databasir.document_remark.table_name</code>.
*/
public String getTableName() {
return (String) get(4);
}
/**
* Setter for <code>databasir.document_remark.column_name</code>.
*/
public void setColumnName(String value) {
set(5, value);
}
/**
* Getter for <code>databasir.document_remark.column_name</code>.
*/
public String getColumnName() {
return (String) get(5);
}
/**
* Setter for <code>databasir.document_remark.create_at</code>.
*/
public void setCreateAt(LocalDateTime value) {
set(6, value);
}
/**
* Getter for <code>databasir.document_remark.create_at</code>.
*/
public LocalDateTime getCreateAt() {
return (LocalDateTime) get(6);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@Override
public Record1<Integer> key() {
return (Record1) super.key();
}
// -------------------------------------------------------------------------
// Record7 type implementation
// -------------------------------------------------------------------------
@Override
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() {
return (Row7) super.fieldsRow();
}
@Override
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> valuesRow() {
return (Row7) super.valuesRow();
}
@Override
public Field<Integer> field1() {
return DocumentRemark.DOCUMENT_REMARK.ID;
}
@Override
public Field<String> field2() {
return DocumentRemark.DOCUMENT_REMARK.REMARK;
}
@Override
public Field<Integer> field3() {
return DocumentRemark.DOCUMENT_REMARK.USER_ID;
}
@Override
public Field<Integer> field4() {
return DocumentRemark.DOCUMENT_REMARK.PROJECT_ID;
}
@Override
public Field<String> field5() {
return DocumentRemark.DOCUMENT_REMARK.TABLE_NAME;
}
@Override
public Field<String> field6() {
return DocumentRemark.DOCUMENT_REMARK.COLUMN_NAME;
}
@Override
public Field<LocalDateTime> field7() {
return DocumentRemark.DOCUMENT_REMARK.CREATE_AT;
}
@Override
public Integer component1() {
return getId();
}
@Override
public String component2() {
return getRemark();
}
@Override
public Integer component3() {
return getUserId();
}
@Override
public Integer component4() {
return getProjectId();
}
@Override
public String component5() {
return getTableName();
}
@Override
public String component6() {
return getColumnName();
}
@Override
public LocalDateTime component7() {
return getCreateAt();
}
@Override
public Integer value1() {
return getId();
}
@Override
public String value2() {
return getRemark();
}
@Override
public Integer value3() {
return getUserId();
}
@Override
public Integer value4() {
return getProjectId();
}
@Override
public String value5() {
return getTableName();
}
@Override
public String value6() {
return getColumnName();
}
@Override
public LocalDateTime value7() {
return getCreateAt();
}
@Override
public DocumentRemarkRecord value1(Integer value) {
setId(value);
return this;
}
@Override
public DocumentRemarkRecord value2(String value) {
setRemark(value);
return this;
}
@Override
public DocumentRemarkRecord value3(Integer value) {
setUserId(value);
return this;
}
@Override
public DocumentRemarkRecord value4(Integer value) {
setProjectId(value);
return this;
}
@Override
public DocumentRemarkRecord value5(String value) {
setTableName(value);
return this;
}
@Override
public DocumentRemarkRecord value6(String value) {
setColumnName(value);
return this;
}
@Override
public DocumentRemarkRecord value7(LocalDateTime value) {
setCreateAt(value);
return this;
}
@Override
public DocumentRemarkRecord values(Integer value1, String value2, Integer value3, Integer value4, String value5, String value6, LocalDateTime value7) {
value1(value1);
value2(value2);
value3(value3);
value4(value4);
value5(value5);
value6(value6);
value7(value7);
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached DocumentRemarkRecord
*/
public DocumentRemarkRecord() {
super(DocumentRemark.DOCUMENT_REMARK);
}
/**
* Create a detached, initialised DocumentRemarkRecord
*/
public DocumentRemarkRecord(Integer id, String remark, Integer userId, Integer projectId, String tableName, String columnName, LocalDateTime createAt) {
super(DocumentRemark.DOCUMENT_REMARK);
setId(id);
setRemark(remark);
setUserId(userId);
setProjectId(projectId);
setTableName(tableName);
setColumnName(columnName);
setCreateAt(createAt);
}
/**
* Create a detached, initialised DocumentRemarkRecord
*/
public DocumentRemarkRecord(DocumentRemarkPojo value) {
super(DocumentRemark.DOCUMENT_REMARK);
if (value != null) {
setId(value.getId());
setRemark(value.getRemark());
setUserId(value.getUserId());
setProjectId(value.getProjectId());
setTableName(value.getTableName());
setColumnName(value.getColumnName());
setCreateAt(value.getCreateAt());
}
}
}

32
dao/src/main/java/com/databasir/dao/impl/DocumentRemarkDao.java

@ -0,0 +1,32 @@
package com.databasir.dao.impl;
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
import com.databasir.dao.tables.records.DocumentRemarkRecord;
import lombok.Getter;
import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Optional;
import static com.databasir.dao.Tables.DOCUMENT_REMARK;
@Repository
public class DocumentRemarkDao extends BaseDao<DocumentRemarkRecord, DocumentRemarkPojo> {
@Autowired
@Getter
private DSLContext dslContext;
public DocumentRemarkDao() {
super(DOCUMENT_REMARK, DocumentRemarkPojo.class);
}
public Optional<DocumentRemarkPojo> selectByProjectIdAndId(Integer projectId, Integer id) {
return this.getDslContext()
.selectFrom(DOCUMENT_REMARK).where(DOCUMENT_REMARK.PROJECT_ID.eq(projectId)
.and(DOCUMENT_REMARK.ID.eq(id)))
.fetchOptionalInto(DocumentRemarkPojo.class);
}
}

2
dao/src/main/java/com/databasir/dao/impl/UserDao.java

@ -45,7 +45,7 @@ public class UserDao extends BaseDao<UserRecord, UserPojo> {
.execute(); .execute();
} }
public List<UserPojo> selectUserIdIn(List<Integer> userIds) { public List<UserPojo> selectUserIdIn(Collection<Integer> userIds) {
if (userIds == null || userIds.isEmpty()) { if (userIds == null || userIds.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }

13
dao/src/main/resources/db/migration/V1__init.sql

@ -220,3 +220,16 @@ CREATE TABLE login
CONSTRAINT UNIQUE uk_user_id (user_id) CONSTRAINT UNIQUE uk_user_id (user_id)
) CHARSET utf8mb4 ) CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci; COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS document_remark
(
id INT PRIMARY KEY AUTO_INCREMENT,
remark TEXT NOT NULL,
user_id INT NOT NULL COMMENT 'user.id',
project_id INT NOT NULL,
table_name VARCHAR(255) NOT NULL,
column_name VARCHAR(255) DEFAULT NULL,
create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX idx_project_id (project_id)
) CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci;
Loading…
Cancel
Save