sawa 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.project +11 -0
- data/README.md +59 -36
- data/bin/sawa +82 -82
- data/lib/sawa/MiniProperty.rb +78 -78
- data/lib/sawa/MiniResource.rb +100 -100
- data/lib/sawa/MiniSheet.rb +191 -191
- data/lib/sawa/MiniWork.rb +31 -31
- data/lib/sawa/tpl/api.mustache +40 -40
- data/lib/sawa/tpl/app.js.mustache +2 -3
- data/lib/sawa/tpl/crud.mustache +30 -30
- data/lib/sawa/tpl/dao.mustache +13 -13
- data/lib/sawa/tpl/model.mustache +56 -56
- data/lib/sawa/tpl/property.mustache +10 -10
- data/lib/sawa/tpl/resource.mustache +47 -47
- data/lib/sawa/version.rb +1 -1
- data/sawa-0.0.4.gem +0 -0
- metadata +5 -4
- data/sawa-0.0.3.gem +0 -0
data/lib/sawa/tpl/model.mustache
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
package {{package_model}};
|
|
2
|
-
|
|
3
|
-
import javax.persistence.Entity;
|
|
4
|
-
import javax.persistence.Table;
|
|
5
|
-
import javax.persistence.Column;
|
|
6
|
-
|
|
7
|
-
import com.jialu.sawa.utility.MiniModel;
|
|
8
|
-
import lombok.Data;
|
|
9
|
-
import lombok.EqualsAndHashCode;
|
|
10
|
-
|
|
11
|
-
{{# model_imports}}
|
|
12
|
-
{{.}}
|
|
13
|
-
{{/ model_imports}}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @author tools
|
|
17
|
-
* {{model_title}}
|
|
18
|
-
*/
|
|
19
|
-
@Entity
|
|
20
|
-
@Table(name = "{{table_name}}")
|
|
21
|
-
@Data
|
|
22
|
-
@EqualsAndHashCode(callSuper = true)
|
|
23
|
-
public class {{model_name}} extends MiniModel{
|
|
24
|
-
|
|
25
|
-
private static final long serialVersionUID = 1L;
|
|
26
|
-
|
|
27
|
-
{{# rows_model}}
|
|
28
|
-
/**
|
|
29
|
-
* {{title}}
|
|
30
|
-
*/
|
|
31
|
-
{{# jsonignore}}
|
|
32
|
-
@JsonIgnore
|
|
33
|
-
{{/jsonignore}}
|
|
34
|
-
{{# has_mapped}}
|
|
35
|
-
{{# is_onetomany}}
|
|
36
|
-
@OneToMany(mappedBy = "{{resource_name}}")
|
|
37
|
-
@JsonManagedReference("{{resource_name}}")
|
|
38
|
-
@Where(clause = "id < 0")
|
|
39
|
-
{{/is_onetomany}}
|
|
40
|
-
{{# is_manytoone}}
|
|
41
|
-
@ManyToOne
|
|
42
|
-
@JsonBackReference("{{name}}")
|
|
43
|
-
@JoinColumn(name="{{join_column}}", nullable=false, insertable = false, updatable = false)
|
|
44
|
-
{{/is_manytoone}}
|
|
45
|
-
{{# is_onetoone}}
|
|
46
|
-
@OneToOne
|
|
47
|
-
@JoinColumn(name="{{join_column}}", nullable=false, insertable = false, updatable = false)
|
|
48
|
-
{{/is_onetoone}}
|
|
49
|
-
{{/has_mapped}}
|
|
50
|
-
{{# is_column}}
|
|
51
|
-
@Column(unique = {{unique}}, nullable = {{nullable}})
|
|
52
|
-
{{/is_column}}
|
|
53
|
-
private {{{type}}} {{name}};
|
|
54
|
-
|
|
55
|
-
{{/ rows_model}}
|
|
56
|
-
}
|
|
1
|
+
package {{package_model}};
|
|
2
|
+
|
|
3
|
+
import javax.persistence.Entity;
|
|
4
|
+
import javax.persistence.Table;
|
|
5
|
+
import javax.persistence.Column;
|
|
6
|
+
|
|
7
|
+
import com.jialu.sawa.utility.MiniModel;
|
|
8
|
+
import lombok.Data;
|
|
9
|
+
import lombok.EqualsAndHashCode;
|
|
10
|
+
|
|
11
|
+
{{# model_imports}}
|
|
12
|
+
{{.}}
|
|
13
|
+
{{/ model_imports}}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @author tools
|
|
17
|
+
* {{model_title}}
|
|
18
|
+
*/
|
|
19
|
+
@Entity
|
|
20
|
+
@Table(name = "{{table_name}}")
|
|
21
|
+
@Data
|
|
22
|
+
@EqualsAndHashCode(callSuper = true)
|
|
23
|
+
public class {{model_name}} extends MiniModel{
|
|
24
|
+
|
|
25
|
+
private static final long serialVersionUID = 1L;
|
|
26
|
+
|
|
27
|
+
{{# rows_model}}
|
|
28
|
+
/**
|
|
29
|
+
* {{title}}
|
|
30
|
+
*/
|
|
31
|
+
{{# jsonignore}}
|
|
32
|
+
@JsonIgnore
|
|
33
|
+
{{/jsonignore}}
|
|
34
|
+
{{# has_mapped}}
|
|
35
|
+
{{# is_onetomany}}
|
|
36
|
+
@OneToMany(mappedBy = "{{resource_name}}")
|
|
37
|
+
@JsonManagedReference("{{resource_name}}")
|
|
38
|
+
@Where(clause = "id < 0")
|
|
39
|
+
{{/is_onetomany}}
|
|
40
|
+
{{# is_manytoone}}
|
|
41
|
+
@ManyToOne
|
|
42
|
+
@JsonBackReference("{{name}}")
|
|
43
|
+
@JoinColumn(name="{{join_column}}", nullable=false, insertable = false, updatable = false)
|
|
44
|
+
{{/is_manytoone}}
|
|
45
|
+
{{# is_onetoone}}
|
|
46
|
+
@OneToOne
|
|
47
|
+
@JoinColumn(name="{{join_column}}", nullable=false, insertable = false, updatable = false)
|
|
48
|
+
{{/is_onetoone}}
|
|
49
|
+
{{/has_mapped}}
|
|
50
|
+
{{# is_column}}
|
|
51
|
+
@Column(unique = {{unique}}, nullable = {{nullable}})
|
|
52
|
+
{{/is_column}}
|
|
53
|
+
private {{{type}}} {{name}};
|
|
54
|
+
|
|
55
|
+
{{/ rows_model}}
|
|
56
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#{resource}.{name}={type},{nullable},{title}
|
|
2
|
-
{{# sheet_arr}}
|
|
3
|
-
{{table_name}}.id=java.lang.Integer,0,id
|
|
4
|
-
{{table_name}}.cuser=java.lang.Integer,0,cuser
|
|
5
|
-
{{table_name}}.uuser=java.lang.Integer,0,uuser
|
|
6
|
-
{{# rows_model}}
|
|
7
|
-
{{# is_column}}
|
|
8
|
-
{{table_name}}.{{name}}={{type}},{{nullable}},{{title}}
|
|
9
|
-
{{/is_column}}
|
|
10
|
-
{{/ rows_model}}
|
|
1
|
+
#{resource}.{name}={type},{nullable},{title}
|
|
2
|
+
{{# sheet_arr}}
|
|
3
|
+
{{table_name}}.id=java.lang.Integer,0,id
|
|
4
|
+
{{table_name}}.cuser=java.lang.Integer,0,cuser
|
|
5
|
+
{{table_name}}.uuser=java.lang.Integer,0,uuser
|
|
6
|
+
{{# rows_model}}
|
|
7
|
+
{{# is_column}}
|
|
8
|
+
{{table_name}}.{{name}}={{type}},{{nullable}},{{title}}
|
|
9
|
+
{{/is_column}}
|
|
10
|
+
{{/ rows_model}}
|
|
11
11
|
{{/ sheet_arr}}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
package {{package_resource}};
|
|
2
|
-
|
|
3
|
-
import {{package_api}}.{{api_name}};
|
|
4
|
-
import {{package_dao}}.{{dao_name}};
|
|
5
|
-
import {{package_model}}.{{model_name}};
|
|
6
|
-
import com.jialu.sawa.utility.MiniBean;
|
|
7
|
-
import com.jialu.sawa.utility.MiniCrudResource;
|
|
8
|
-
import com.jialu.sawa.vo.*;
|
|
9
|
-
|
|
10
|
-
{{# resource_imports}}
|
|
11
|
-
{{.}}
|
|
12
|
-
{{/ resource_imports}}
|
|
13
|
-
|
|
14
|
-
public class {{resource_name}} extends MiniCrudResource<{{model_name}}, {{dao_name}}> implements {{api_name}}{
|
|
15
|
-
|
|
16
|
-
public {{resource_name}}(MiniBean config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@Override
|
|
21
|
-
public {{dao_name}} getDao() {
|
|
22
|
-
return config.getDao({{dao_name}}.class);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@Override
|
|
26
|
-
public Class<{{model_name}}> getModelT() {
|
|
27
|
-
return {{model_name}}.class;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
{{# rows_path}}
|
|
31
|
-
/**
|
|
32
|
-
* {{resource_desc}}
|
|
33
|
-
*/
|
|
34
|
-
@Override
|
|
35
|
-
{{# resource_islist}}
|
|
36
|
-
public OperatorResult<List<{{model_name}}>> {{resource_method}}({{{resource_param_type}}}) {
|
|
37
|
-
return {{resource_process}}({{{resource_param_value}}});
|
|
38
|
-
}
|
|
39
|
-
{{/ resource_islist}}
|
|
40
|
-
{{^ resource_islist}}
|
|
41
|
-
public OperatorResult<{{model_name}}> {{resource_method}}({{{resource_param_type}}}) {
|
|
42
|
-
return {{resource_process}}({{{resource_param_value}}});
|
|
43
|
-
}
|
|
44
|
-
{{/ resource_islist}}
|
|
45
|
-
{{/ rows_path}}
|
|
46
|
-
|
|
47
|
-
}
|
|
1
|
+
package {{package_resource}};
|
|
2
|
+
|
|
3
|
+
import {{package_api}}.{{api_name}};
|
|
4
|
+
import {{package_dao}}.{{dao_name}};
|
|
5
|
+
import {{package_model}}.{{model_name}};
|
|
6
|
+
import com.jialu.sawa.utility.MiniBean;
|
|
7
|
+
import com.jialu.sawa.utility.MiniCrudResource;
|
|
8
|
+
import com.jialu.sawa.vo.*;
|
|
9
|
+
|
|
10
|
+
{{# resource_imports}}
|
|
11
|
+
{{.}}
|
|
12
|
+
{{/ resource_imports}}
|
|
13
|
+
|
|
14
|
+
public class {{resource_name}} extends MiniCrudResource<{{model_name}}, {{dao_name}}> implements {{api_name}}{
|
|
15
|
+
|
|
16
|
+
public {{resource_name}}(MiniBean config) {
|
|
17
|
+
super(config);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public {{dao_name}} getDao() {
|
|
22
|
+
return config.getDao({{dao_name}}.class);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
public Class<{{model_name}}> getModelT() {
|
|
27
|
+
return {{model_name}}.class;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
{{# rows_path}}
|
|
31
|
+
/**
|
|
32
|
+
* {{resource_desc}}
|
|
33
|
+
*/
|
|
34
|
+
@Override
|
|
35
|
+
{{# resource_islist}}
|
|
36
|
+
public OperatorResult<List<{{model_name}}>> {{resource_method}}({{{resource_param_type}}}) {
|
|
37
|
+
return {{resource_process}}({{{resource_param_value}}});
|
|
38
|
+
}
|
|
39
|
+
{{/ resource_islist}}
|
|
40
|
+
{{^ resource_islist}}
|
|
41
|
+
public OperatorResult<{{model_name}}> {{resource_method}}({{{resource_param_type}}}) {
|
|
42
|
+
return {{resource_process}}({{{resource_param_value}}});
|
|
43
|
+
}
|
|
44
|
+
{{/ resource_islist}}
|
|
45
|
+
{{/ rows_path}}
|
|
46
|
+
|
|
47
|
+
}
|
data/lib/sawa/version.rb
CHANGED
data/sawa-0.0.4.gem
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sawa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- shouaya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-07-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -107,6 +107,7 @@ extensions: []
|
|
|
107
107
|
extra_rdoc_files: []
|
|
108
108
|
files:
|
|
109
109
|
- ".gitignore"
|
|
110
|
+
- ".project"
|
|
110
111
|
- CODE_OF_CONDUCT.md
|
|
111
112
|
- Gemfile
|
|
112
113
|
- LICENSE.txt
|
|
@@ -127,7 +128,7 @@ files:
|
|
|
127
128
|
- lib/sawa/tpl/property.mustache
|
|
128
129
|
- lib/sawa/tpl/resource.mustache
|
|
129
130
|
- lib/sawa/version.rb
|
|
130
|
-
- sawa-0.0.
|
|
131
|
+
- sawa-0.0.4.gem
|
|
131
132
|
- sawa.gemspec
|
|
132
133
|
homepage: https://github.com/shouaya/sawagem
|
|
133
134
|
licenses:
|
|
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
149
150
|
version: '0'
|
|
150
151
|
requirements: []
|
|
151
152
|
rubyforge_project:
|
|
152
|
-
rubygems_version: 2.
|
|
153
|
+
rubygems_version: 2.6.11
|
|
153
154
|
signing_key:
|
|
154
155
|
specification_version: 4
|
|
155
156
|
summary: '"rest system build with sawa"'
|
data/sawa-0.0.3.gem
DELETED
|
Binary file
|