|
|
@ -11,6 +11,8 @@ import com.luoo.music.pojo.UserInfo;
|
|
|
|
import com.luoo.music.util.Constants;
|
|
|
|
import com.luoo.music.util.Constants;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.data.domain.Example;
|
|
|
|
|
|
|
|
import org.springframework.data.domain.ExampleMatcher;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
@ -76,7 +78,19 @@ public class CMSAdvertisementService {
|
|
|
|
ad.setUserName(userInfo.getName());
|
|
|
|
ad.setUserName(userInfo.getName());
|
|
|
|
ad.setUserType(userInfo.getType());
|
|
|
|
ad.setUserType(userInfo.getType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example<Advertisement> example = Example.of(ad, ExampleMatcher.matching()
|
|
|
|
|
|
|
|
.withIgnorePaths("id")
|
|
|
|
|
|
|
|
.withIgnorePaths("image")
|
|
|
|
|
|
|
|
.withIgnorePaths("pub_time")
|
|
|
|
|
|
|
|
.withIgnorePaths("createTime")
|
|
|
|
|
|
|
|
.withIgnorePaths("updateTime")
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!adDao.exists(example)) {
|
|
|
|
adDao.save(ad);
|
|
|
|
adDao.save(ad);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success();
|
|
|
|
return Result.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|