|
@ -156,7 +156,7 @@ public class WareService {
|
156
|
156
|
String id = StringUtil.buildUUID();
|
157
|
157
|
ware.setId(id);
|
158
|
158
|
wareDao.insert(con, ware);
|
159
|
|
this.saveSmallImg(ware.getImges());
|
|
159
|
this.saveSmallImg(ware.getImages());
|
160
|
160
|
String[] kws = null;
|
161
|
161
|
if (ware.getKeywords() != null) {
|
162
|
162
|
kws = ListUtil.splitTrimExcludeEmpty(ware.getKeywords(), ',').toArray(new String[0]);
|
|
@ -186,7 +186,7 @@ public class WareService {
|
186
|
186
|
public boolean update(Connection con, Ware ware, String[] professor, String[] resource) throws SQLException, IOException {
|
187
|
187
|
String id = ware.getId();
|
188
|
188
|
if (wareDao.update(con, ware) > 0) {
|
189
|
|
this.saveSmallImg(ware.getImges());
|
|
189
|
this.saveSmallImg(ware.getImages());
|
190
|
190
|
String[] kws = null;
|
191
|
191
|
if (ware.getKeywords() != null) {
|
192
|
192
|
kws = ListUtil.splitTrimExcludeEmpty(ware.getKeywords(), ',').toArray(new String[0]);
|
|
@ -231,7 +231,7 @@ public class WareService {
|
231
|
231
|
*/
|
232
|
232
|
@Post
|
233
|
233
|
@Path("/draft")
|
234
|
|
public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "publishTime",
|
|
234
|
public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
235
|
235
|
"shareId", "pageViews", "sortFirst" }) Ware ware, @Nullable String[] resource) throws SQLException, IOException {
|
236
|
236
|
ware.setState("2");
|
237
|
237
|
ware.setCategory("1");
|
|
@ -251,7 +251,7 @@ public class WareService {
|
251
|
251
|
*/
|
252
|
252
|
@Post
|
253
|
253
|
@Path("/draft/org")
|
254
|
|
public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "publishTime",
|
|
254
|
public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
255
|
255
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
256
|
256
|
ware.setState("2");
|
257
|
257
|
ware.setCategory("2");
|
|
@ -270,7 +270,7 @@ public class WareService {
|
270
|
270
|
*/
|
271
|
271
|
@Post
|
272
|
272
|
@Path("/publish")
|
273
|
|
public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "publishTime",
|
|
273
|
public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
274
|
274
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource) throws SQLException, IOException {
|
275
|
275
|
ware.setState("1");
|
276
|
276
|
ware.setCategory("1");
|
|
@ -290,7 +290,7 @@ public class WareService {
|
290
|
290
|
*/
|
291
|
291
|
@Post
|
292
|
292
|
@Path("/publish/org")
|
293
|
|
public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "publishTime",
|
|
293
|
public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
294
|
294
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
295
|
295
|
ware.setState("1");
|
296
|
296
|
ware.setCategory("2");
|
|
@ -309,8 +309,8 @@ public class WareService {
|
309
|
309
|
*/
|
310
|
310
|
@Post
|
311
|
311
|
@Path("/draft/update")
|
312
|
|
public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
313
|
|
"publishTime", "shareId", "pageViews", "sortFirst" }) Ware ware, @Nullable String[] resource) throws SQLException, IOException {
|
|
312
|
public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
|
|
313
|
"shareId", "pageViews", "sortFirst" }) Ware ware, @Nullable String[] resource) throws SQLException, IOException {
|
314
|
314
|
ware.setState("2");
|
315
|
315
|
ware.setCategory("1");
|
316
|
316
|
return update(con, ware, null, resource);
|
|
@ -329,8 +329,8 @@ public class WareService {
|
329
|
329
|
*/
|
330
|
330
|
@Post
|
331
|
331
|
@Path("/draft/org/update")
|
332
|
|
public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
333
|
|
"publishTime", "shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
|
332
|
public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
|
|
333
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
334
|
334
|
ware.setState("2");
|
335
|
335
|
ware.setCategory("2");
|
336
|
336
|
return update(con, ware, professor, resource);
|
|
@ -348,8 +348,8 @@ public class WareService {
|
348
|
348
|
*/
|
349
|
349
|
@Post
|
350
|
350
|
@Path("/publish/update")
|
351
|
|
public String updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
352
|
|
"publishTime", "shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource) throws SQLException, IOException {
|
|
351
|
public String updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
|
|
352
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource) throws SQLException, IOException {
|
353
|
353
|
ware.setState("1");
|
354
|
354
|
ware.setCategory("1");
|
355
|
355
|
return insert(con, ware, null, resource);
|
|
@ -368,8 +368,8 @@ public class WareService {
|
368
|
368
|
*/
|
369
|
369
|
@Post
|
370
|
370
|
@Path("/publish/org/update")
|
371
|
|
public String updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime",
|
372
|
|
"publishTime", "shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
|
371
|
public String updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
|
|
372
|
"shareId", "pageViews", "sortFirst" }) Ware ware, String[] resource, String[] professor) throws SQLException, IOException {
|
373
|
373
|
ware.setState("1");
|
374
|
374
|
ware.setCategory("2");
|
375
|
375
|
return insert(con, ware, professor, resource);
|
|
@ -601,7 +601,7 @@ public class WareService {
|
601
|
601
|
}
|
602
|
602
|
|
603
|
603
|
@Get
|
604
|
|
@Path("/index/seach")
|
|
604
|
@Path("/index/search")
|
605
|
605
|
public List<Ware> indexSeach(@JdbcConn Connection con, @Nullable String key, @DefaultValue("Long.MAX_VALUE") long sortFirst,
|
606
|
606
|
@DefaultValue("\"9\"") String time, @DefaultValue("\"G\"") String id, int rows) throws SQLException {
|
607
|
607
|
if (key != null) {
|
|
@ -642,6 +642,12 @@ public class WareService {
|
642
|
642
|
public List<Ware> queryByResourceWithModifyTime(@JdbcConn Connection con,String id,int rows) throws SQLException{
|
643
|
643
|
return wareDao.queryByResource(con, id, rows);
|
644
|
644
|
}
|
|
645
|
@Get
|
|
646
|
@Path("/byArticle")
|
|
647
|
public List<Ware> queryByArticle(@JdbcConn Connection con,String id,@DefaultValue("Integer.MAX_VALUE" ) int rows) throws SQLException{
|
|
648
|
return wareDao.queryByArticle(con, id, rows);
|
|
649
|
}
|
|
650
|
|
645
|
651
|
//
|
646
|
652
|
// @Post
|
647
|
653
|
// @Path("/update")
|