Browse Source

发布资源时添加是否上传图片的判断。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
9434f9fa04
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/main/java/com/ekexiu/portal/service/ResourceService.java

+ 4 - 2
src/main/java/com/ekexiu/portal/service/ResourceService.java

@ -58,10 +58,12 @@ public class ResourceService {
58 58

59 59
	@Post
60 60
	@Path
61
	public String insert(@JdbcConn(true) Connection con, Resource resource, String fn) {
61
	public String insert(@JdbcConn(true) Connection con, Resource resource, @Nullable String fn) {
62 62
		String resourceId = StringUtil.buildUUID();
63 63
		try {
64
			this.imagesService.insert(con, resourceId, fn);
64
			if(null != fn){
65
				this.imagesService.insert(con, resourceId, fn);
66
			}
65 67
			resource.setResourceId(resourceId);
66 68
			this.resourceDao.insert(con, resource);
67 69
		} catch (SQLException | IOException e) {