--- src/main/java/itn/let/kakao/kakaoComm/kakaoApi/KakaoApiImageUpload.java
+++ src/main/java/itn/let/kakao/kakaoComm/kakaoApi/KakaoApiImageUpload.java
... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 |
import java.io.File; |
| 6 | 6 |
import java.io.FileInputStream; |
| 7 | 7 |
import java.io.InputStream; |
| 8 |
+import java.time.LocalDateTime; |
|
| 8 | 9 |
import java.util.ArrayList; |
| 9 | 10 |
import java.util.HashMap; |
| 10 | 11 |
import java.util.List; |
... | ... | @@ -15,6 +16,7 @@ |
| 15 | 16 |
import javax.imageio.ImageIO; |
| 16 | 17 |
import javax.swing.ImageIcon; |
| 17 | 18 |
|
| 19 |
+import org.apache.commons.io.FilenameUtils; |
|
| 18 | 20 |
import org.apache.http.HttpEntity; |
| 19 | 21 |
import org.apache.http.HttpResponse; |
| 20 | 22 |
import org.apache.http.client.HttpClient; |
... | ... | @@ -30,6 +32,7 @@ |
| 30 | 32 |
import org.json.simple.JSONObject; |
| 31 | 33 |
import org.json.simple.parser.JSONParser; |
| 32 | 34 |
import org.springframework.beans.factory.annotation.Value; |
| 35 |
+import org.springframework.http.HttpStatus; |
|
| 33 | 36 |
import org.springframework.stereotype.Component; |
| 34 | 37 |
import org.springframework.web.multipart.MultipartFile; |
| 35 | 38 |
|
... | ... | @@ -38,8 +41,11 @@ |
| 38 | 41 |
import itn.com.cmm.service.FileVO; |
| 39 | 42 |
import itn.let.kakao.kakaoComm.KakaoReturnVO; |
| 40 | 43 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 44 |
+import itn.let.mail.service.StatusResponse; |
|
| 41 | 45 |
import itn.let.utl.fcc.service.EgovStringUtil; |
| 46 |
+import lombok.extern.slf4j.Slf4j; |
|
| 42 | 47 |
|
| 48 |
+@Slf4j |
|
| 43 | 49 |
@Component("kakaoApiImageUpload")
|
| 44 | 50 |
public class KakaoApiImageUpload {
|
| 45 | 51 |
|
... | ... | @@ -219,13 +225,13 @@ |
| 219 | 225 |
.addTextBody("bizId", mjonBizId)
|
| 220 | 226 |
.addTextBody("apiKey", mjonBizKakaoApiKey)
|
| 221 | 227 |
.addTextBody("imageType", kakaoVO.getImageType())
|
| 222 |
- .addTextBody("title", kakaoVO.getImgTitle())
|
|
| 223 |
- .addTextBody("link", kakaoVO.getImgLink())
|
|
| 228 |
+ .addTextBody("title", "test")
|
|
| 229 |
+ .addTextBody("link", "https://maaa.com")
|
|
| 224 | 230 |
.addTextBody("senderKey", kakaoVO.getSenderKey())
|
| 225 | 231 |
.addBinaryBody("image", new File(filePath),ContentType.MULTIPART_FORM_DATA,fullFileName)
|
| 226 | 232 |
.build(); |
| 227 | 233 |
|
| 228 |
- httpPost.setEntity(httpEntity); |
|
| 234 |
+ httpPost.setEntity(httpEntity); |
|
| 229 | 235 |
|
| 230 | 236 |
CloseableHttpResponse response = httpClient.execute(httpPost); |
| 231 | 237 |
|
... | ... | @@ -245,6 +251,7 @@ |
| 245 | 251 |
String msg = object.get("message").toString();
|
| 246 | 252 |
String imgUrl = ""; |
| 247 | 253 |
|
| 254 |
+ log.info(" : code :: [{}]", code);
|
|
| 248 | 255 |
if(code.equals("200")) {
|
| 249 | 256 |
imgUrl = object.get("image").toString();
|
| 250 | 257 |
} |
... | ... | @@ -271,6 +278,113 @@ |
| 271 | 278 |
} |
| 272 | 279 |
return resultMap; |
| 273 | 280 |
} |
| 281 |
+ |
|
| 282 |
+ |
|
| 283 |
+ |
|
| 284 |
+ |
|
| 285 |
+ /** |
|
| 286 |
+ * @methodName : kakaoApiImageUpload_advc |
|
| 287 |
+ * @author : 이호영 |
|
| 288 |
+ * @date : 2025. 6. 4. |
|
| 289 |
+ * @description : kakaoApiImageUpload 수정 |
|
| 290 |
+ * @return : StatusResponse |
|
| 291 |
+ * @param kakaoVO |
|
| 292 |
+ * @param files |
|
| 293 |
+ * @param i |
|
| 294 |
+ * @return |
|
| 295 |
+ * |
|
| 296 |
+ */ |
|
| 297 |
+ public StatusResponse kakaoApiImageUpload_advc(KakaoVO kakaoVO, Map<String, MultipartFile> files, int fileKeyParam) {
|
|
| 298 |
+ try {
|
|
| 299 |
+ String storePathString = propertyService.getString("Globals.fileStorePath");
|
|
| 300 |
+ File saveFolder = new File(storePathString); |
|
| 301 |
+ if (!saveFolder.exists()) saveFolder.mkdirs(); |
|
| 302 |
+ |
|
| 303 |
+ for (MultipartFile file : files.values()) {
|
|
| 304 |
+ if (file.isEmpty()) continue; |
|
| 305 |
+ |
|
| 306 |
+ String originalName = file.getOriginalFilename(); |
|
| 307 |
+ if (originalName == null || originalName.isEmpty()) continue; |
|
| 308 |
+ |
|
| 309 |
+ String ext = FilenameUtils.getExtension(originalName).toLowerCase(); |
|
| 310 |
+ if (!ext.matches("jpg|jpeg|png")) {
|
|
| 311 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "지원하지 않는 이미지 형식입니다."); |
|
| 312 |
+ } |
|
| 313 |
+ |
|
| 314 |
+ long size = file.getSize(); |
|
| 315 |
+ if (size > 5 * 1024 * 1024) {
|
|
| 316 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "이미지 용량은 5MB 이내여야 합니다."); |
|
| 317 |
+ } |
|
| 318 |
+ |
|
| 319 |
+ BufferedImage image = ImageIO.read(file.getInputStream()); |
|
| 320 |
+ if (image == null) {
|
|
| 321 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "이미지를 읽을 수 없습니다."); |
|
| 322 |
+ } |
|
| 323 |
+ |
|
| 324 |
+ int width = image.getWidth(); |
|
| 325 |
+ int height = image.getHeight(); |
|
| 326 |
+ String type = kakaoVO.getImageType(); |
|
| 327 |
+ |
|
| 328 |
+ if ("W".equals(type)) {
|
|
| 329 |
+ if (width != 800 || height != 600) {
|
|
| 330 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "와이드 이미지는 800x600 사이즈만 허용됩니다."); |
|
| 331 |
+ } |
|
| 332 |
+ } else {
|
|
| 333 |
+ float ratio = width / (float) height; |
|
| 334 |
+ if (width < 500 || ratio < 0.5 || ratio > 0.75) {
|
|
| 335 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "일반 이미지 조건 위반: 가로 500px 이상, 비율 2:1 미만 및 3:4 초과 불가"); |
|
| 336 |
+ } |
|
| 337 |
+ } |
|
| 338 |
+ |
|
| 339 |
+ String newName = EgovStringUtil.getTimeStamp() + fileKeyParam; |
|
| 340 |
+ String filePath = storePathString + File.separator + newName + "." + ext; |
|
| 341 |
+ file.transferTo(new File(filePath)); |
|
| 342 |
+ |
|
| 343 |
+ // 카카오 API 호출 |
|
| 344 |
+ CloseableHttpClient httpClient = HttpClients.createDefault(); |
|
| 345 |
+ String apiUrl = mjonBizUrl + "/v3/kakao/image/upload"; |
|
| 346 |
+ |
|
| 347 |
+ HttpPost httpPost = new HttpPost(apiUrl); |
|
| 348 |
+ HttpEntity httpEntity = MultipartEntityBuilder.create() |
|
| 349 |
+ .addTextBody("bizId", mjonBizId)
|
|
| 350 |
+ .addTextBody("apiKey", mjonBizKakaoApiKey)
|
|
| 351 |
+ .addTextBody("imageType", kakaoVO.getImageType())
|
|
| 352 |
+ .addTextBody("title", kakaoVO.getImgTitle())
|
|
| 353 |
+ .addTextBody("link", kakaoVO.getImgLink())
|
|
| 354 |
+ .addTextBody("senderKey", kakaoVO.getSenderKey())
|
|
| 355 |
+ .addBinaryBody("image", new File(filePath), ContentType.MULTIPART_FORM_DATA, newName + "." + ext)
|
|
| 356 |
+ .build(); |
|
| 357 |
+ httpPost.setEntity(httpEntity); |
|
| 358 |
+ |
|
| 359 |
+ CloseableHttpResponse response = httpClient.execute(httpPost); |
|
| 360 |
+ int statusCode = response.getStatusLine().getStatusCode(); |
|
| 361 |
+ |
|
| 362 |
+ if (statusCode == 200) {
|
|
| 363 |
+ String result = EntityUtils.toString(response.getEntity(), "UTF-8"); |
|
| 364 |
+ JSONParser parser = new JSONParser(); |
|
| 365 |
+ JSONObject object = (JSONObject) parser.parse(result); |
|
| 366 |
+ |
|
| 367 |
+ String code = object.get("code").toString();
|
|
| 368 |
+ if ("200".equals(code)) {
|
|
| 369 |
+ Map<String, Object> returnMap = new HashMap<>(); |
|
| 370 |
+ returnMap.put("imgUrl", object.get("image").toString());
|
|
| 371 |
+ returnMap.put("fileName", originalName);
|
|
| 372 |
+ |
|
| 373 |
+ return new StatusResponse(HttpStatus.OK, "이미지 등록이 완료 되었습니다.", returnMap); |
|
| 374 |
+ } else {
|
|
| 375 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, object.get("message").toString(), LocalDateTime.now());
|
|
| 376 |
+ } |
|
| 377 |
+ } else {
|
|
| 378 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "카카오 API 요청 실패", LocalDateTime.now()); |
|
| 379 |
+ } |
|
| 380 |
+ } |
|
| 381 |
+ } catch (Exception e) {
|
|
| 382 |
+ log.error("kakaoApiImageUpload_advc API Error", e);
|
|
| 383 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "친구톡 이미지 등록에 실패했습니다.", LocalDateTime.now()); |
|
| 384 |
+ } |
|
| 385 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "유효한 이미지 파일이 없습니다.", LocalDateTime.now()); |
|
| 386 |
+ } |
|
| 387 |
+ |
|
| 274 | 388 |
|
| 275 | 389 |
|
| 276 | 390 |
/** |
... | ... | @@ -528,5 +642,7 @@ |
| 528 | 642 |
|
| 529 | 643 |
return kakaoReturnVO; |
| 530 | 644 |
} |
| 645 |
+ |
|
| 646 |
+ |
|
| 531 | 647 |
|
| 532 | 648 |
} |
--- src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkTemplateController.java
+++ src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkTemplateController.java
... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 |
package itn.let.kakao.user.kakaoFt.web; |
| 2 | 2 |
|
| 3 |
+import java.time.LocalDateTime; |
|
| 3 | 4 |
import java.util.ArrayList; |
| 4 | 5 |
import java.util.List; |
| 5 | 6 |
import java.util.Map; |
... | ... | @@ -8,11 +9,15 @@ |
| 8 | 9 |
import javax.servlet.http.HttpServletRequest; |
| 9 | 10 |
import javax.servlet.http.HttpServletResponse; |
| 10 | 11 |
|
| 12 |
+import org.apache.commons.lang3.StringUtils; |
|
| 11 | 13 |
import org.springframework.beans.factory.annotation.Autowired; |
| 14 |
+import org.springframework.http.HttpStatus; |
|
| 15 |
+import org.springframework.http.ResponseEntity; |
|
| 12 | 16 |
import org.springframework.stereotype.Controller; |
| 13 | 17 |
import org.springframework.ui.ModelMap; |
| 14 | 18 |
import org.springframework.web.bind.annotation.ModelAttribute; |
| 15 | 19 |
import org.springframework.web.bind.annotation.RequestMapping; |
| 20 |
+import org.springframework.web.bind.annotation.ResponseBody; |
|
| 16 | 21 |
import org.springframework.web.multipart.MultipartFile; |
| 17 | 22 |
import org.springframework.web.multipart.MultipartHttpServletRequest; |
| 18 | 23 |
import org.springframework.web.servlet.ModelAndView; |
... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 |
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; |
| 22 | 27 |
import itn.com.cmm.EgovMessageSource; |
| 23 | 28 |
import itn.com.cmm.LoginVO; |
| 29 |
+import itn.com.cmm.RestResponse; |
|
| 24 | 30 |
import itn.com.cmm.service.EgovCmmUseService; |
| 25 | 31 |
import itn.com.utl.fcc.service.EgovStringUtil; |
| 26 | 32 |
import itn.let.kakao.kakaoComm.KakaoReturnVO; |
... | ... | @@ -32,6 +38,7 @@ |
| 32 | 38 |
import itn.let.kakao.kakaoComm.kakaoApi.KakaoFTJsonSave; |
| 33 | 39 |
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService; |
| 34 | 40 |
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkTemplateService; |
| 41 |
+import itn.let.mail.service.StatusResponse; |
|
| 35 | 42 |
import itn.let.mjo.symbol.service.MjonSymbolService; |
| 36 | 43 |
import itn.let.mjo.symbol.service.MjonSymbolVO; |
| 37 | 44 |
import itn.let.uss.umt.service.EgovUserManageService; |
... | ... | @@ -170,6 +177,56 @@ |
| 170 | 177 |
|
| 171 | 178 |
return modelAndView; |
| 172 | 179 |
} |
| 180 |
+ |
|
| 181 |
+ @ResponseBody |
|
| 182 |
+ @RequestMapping(value= {"/web/mjon/kakao/template/sendKakaoFriendsTemplateImageUploadAjax_advc.do"})
|
|
| 183 |
+ public ResponseEntity<StatusResponse> sendKakaoFriendsTemplateImageUploadAjax_advc( |
|
| 184 |
+ @ModelAttribute("kakaoVO") KakaoVO kakaoVO
|
|
| 185 |
+ , final MultipartHttpServletRequest multiRequest |
|
| 186 |
+ ) throws Exception {
|
|
| 187 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 188 |
+ modelAndView.setViewName("jsonView");
|
|
| 189 |
+ |
|
| 190 |
+ try {
|
|
| 191 |
+ LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; |
|
| 192 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 193 |
+ |
|
| 194 |
+ if(StringUtils.isEmpty(userId)) { //KISA 보안취약점 조치 (2018-12-10, 이정은)
|
|
| 195 |
+ return ResponseEntity.ok( |
|
| 196 |
+ new StatusResponse(HttpStatus.UNAUTHORIZED |
|
| 197 |
+ , "로그인을 하셔야 이용 가능합니다." |
|
| 198 |
+ , LocalDateTime.now() |
|
| 199 |
+ ) |
|
| 200 |
+ ); |
|
| 201 |
+ } |
|
| 202 |
+ |
|
| 203 |
+ |
|
| 204 |
+ |
|
| 205 |
+ final Map<String, MultipartFile> files = multiRequest.getFileMap(); |
|
| 206 |
+ /* if (!files.isEmpty()){
|
|
| 207 |
+ |
|
| 208 |
+ Map<String, String> resultMap = kakaoApiImageUpload.kakaoApiImageUpload(kakaoVO, files, 0); |
|
| 209 |
+ |
|
| 210 |
+ //테스트 용 |
|
| 211 |
+ modelAndView.addObject("code", resultMap.get("code"));
|
|
| 212 |
+ modelAndView.addObject("msg", resultMap.get("msg"));
|
|
| 213 |
+ modelAndView.addObject("imgUrl", resultMap.get("imgUrl"));
|
|
| 214 |
+ } |
|
| 215 |
+ |
|
| 216 |
+ modelAndView.addObject("result", "success");*/
|
|
| 217 |
+ |
|
| 218 |
+ return ResponseEntity.ok().body(kakaoApiImageUpload.kakaoApiImageUpload_advc(kakaoVO, files, 0)); |
|
| 219 |
+ } catch (Exception e) {
|
|
| 220 |
+ e.printStackTrace(); |
|
| 221 |
+ // TODO: handle exception |
|
| 222 |
+ return ResponseEntity.ok().body(new StatusResponse( |
|
| 223 |
+ HttpStatus.BAD_REQUEST |
|
| 224 |
+ , "오류가 발생하였습니다." |
|
| 225 |
+ , "" |
|
| 226 |
+ )); |
|
| 227 |
+ } |
|
| 228 |
+ |
|
| 229 |
+ } |
|
| 173 | 230 |
|
| 174 | 231 |
|
| 175 | 232 |
// 카카오 친구톡 템플릿 등록요청 |
--- src/main/java/itn/let/mail/service/StatusResponse.java
+++ src/main/java/itn/let/mail/service/StatusResponse.java
... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 |
import org.springframework.http.HttpStatus; |
| 6 | 6 |
|
| 7 | 7 |
import itn.let.mjo.pay.service.RefundVO; |
| 8 |
+import lombok.AllArgsConstructor; |
|
| 8 | 9 |
import lombok.Builder; |
| 9 | 10 |
import lombok.Getter; |
| 10 | 11 |
import lombok.NoArgsConstructor; |
--- src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
... | ... | @@ -414,7 +414,7 @@ |
| 414 | 414 |
} |
| 415 | 415 |
|
| 416 | 416 |
//이미지 선택시 링크 정보 및 url 패턴 검사 |
| 417 |
- if(link == ''){
|
|
| 417 |
+ /* if(link == ''){
|
|
| 418 | 418 |
|
| 419 | 419 |
$("#imgNm").text("");
|
| 420 | 420 |
$("#imgFile").val("");
|
... | ... | @@ -427,7 +427,7 @@ |
| 427 | 427 |
$("#imgFile").val("");
|
| 428 | 428 |
alert("이미지 URL 주소에는 http:// 또는 https://를 포함하여 입력해야 합니다.");
|
| 429 | 429 |
return false; |
| 430 |
- } |
|
| 430 |
+ } */ |
|
| 431 | 431 |
|
| 432 | 432 |
//첨부파일 선택 팝업 호출해주기 |
| 433 | 433 |
$("#imgFile").click();
|
... | ... | @@ -485,6 +485,7 @@ |
| 485 | 485 |
} |
| 486 | 486 |
|
| 487 | 487 |
|
| 488 |
+// var url = url = "/web/mjon/kakao/template/sendKakaoFriendsTemplateImageUploadAjax_advc.do"; |
|
| 488 | 489 |
var url = url = "/web/mjon/kakao/template/sendKakaoFriendsTemplateImageUploadAjax.do"; |
| 489 | 490 |
|
| 490 | 491 |
$.ajax({
|
... | ... | @@ -500,7 +501,32 @@ |
| 500 | 501 |
, success : function(returnData){
|
| 501 | 502 |
console.log('returnData : ', returnData);
|
| 502 | 503 |
|
| 503 |
- if(returnData.result == "success") {
|
|
| 504 |
+ |
|
| 505 |
+ |
|
| 506 |
+ if (returnData.status === 'OK' || returnData.status === 200) {
|
|
| 507 |
+ alert(returnData.message); |
|
| 508 |
+ |
|
| 509 |
+ $("#templateImageName").val(fileName);
|
|
| 510 |
+ $("#imageFileName").val(fileName);
|
|
| 511 |
+ |
|
| 512 |
+ // imgUrl은 object에 포함된 경우만 처리 |
|
| 513 |
+ if (returnData.object) {
|
|
| 514 |
+ $("#templateImageUrl").val(returnData.object);
|
|
| 515 |
+ $(".kakao_image").css("display", "block");
|
|
| 516 |
+ $("#kakaoImg").attr("src", returnData.object);
|
|
| 517 |
+ } |
|
| 518 |
+ |
|
| 519 |
+ } else {
|
|
| 520 |
+ alert(returnData.message || "이미지 등록 중 오류가 발생하였습니다."); |
|
| 521 |
+ |
|
| 522 |
+ // 첨부파일 정보 초기화 |
|
| 523 |
+ $("#imgFile").val("");
|
|
| 524 |
+ $("#imgNm").text("");
|
|
| 525 |
+ return false; |
|
| 526 |
+ } |
|
| 527 |
+ }, |
|
| 528 |
+ |
|
| 529 |
+ /* if(returnData.result == "success") {
|
|
| 504 | 530 |
|
| 505 | 531 |
var code = returnData.code; |
| 506 | 532 |
var msg = returnData.msg; |
... | ... | @@ -549,7 +575,7 @@ |
| 549 | 575 |
alert("이미지 등록 중 오류가 발생하였습니다.!!!");
|
| 550 | 576 |
return false; |
| 551 | 577 |
} |
| 552 |
- }, |
|
| 578 |
+ }, */ |
|
| 553 | 579 |
beforeSend : function(xmlHttpRequest) {
|
| 554 | 580 |
//로딩창 show |
| 555 | 581 |
$('.loading_layer').addClass('active');
|
... | ... | @@ -1574,49 +1600,82 @@ |
| 1574 | 1600 |
<tr> |
| 1575 | 1601 |
<th>이미지 첨부</th> |
| 1576 | 1602 |
<td> |
| 1577 |
- <div class="img_sort_wrap"> |
|
| 1578 |
- <input type="radio" name="img_file_add" id="img_file_0" value="" <c:if test="${resultTemplateVO.imageType eq ''}">checked</c:if> > <label for="img_file_0">첨부안함</label>
|
|
| 1579 |
- <input type="radio" name="img_file_add" id="img_file_1" value="I" <c:if test="${resultTemplateVO.imageType eq 'I'}">checked</c:if> > <label for="img_file_1">이미지 첨부</label>
|
|
| 1580 |
- <input type="radio" name="img_file_add" id="img_file_2" value="W" <c:if test="${resultTemplateVO.imageType eq 'W'}">checked</c:if> > <label for="img_file_2">와이드 이미지 첨부</label>
|
|
| 1581 |
- <div class="img_add_info_wrap basic_img_add_wrap"> |
|
| 1582 |
- <p class="info_title_text"><span class="c_e40000">*</span> 이미지 첨부 안내</p> |
|
| 1583 |
- <ul class="info_text"> |
|
| 1584 |
- <li>- 권장사이즈 : 720px * 720px</li> |
|
| 1603 |
+ <input type="radio" name="img_file_add" id="img_file_0" value="" <c:if test="${resultTemplateVO.imageType eq ''}">checked</c:if> >
|
|
| 1604 |
+ <label for="img_file_0">첨부 안함</label> |
|
| 1605 |
+ <input type="radio" name="img_file_add" id="img_file_1" value="I" <c:if test="${resultTemplateVO.imageType eq 'I'}">checked</c:if> >
|
|
| 1606 |
+ <label for="img_file_1">이미지 첨부</label> |
|
| 1607 |
+ <input type="radio" name="img_file_add" id="img_file_2" value="W" <c:if test="${resultTemplateVO.imageType eq 'W'}">checked</c:if> >
|
|
| 1608 |
+ <label for="img_file_2">와이드 이미지 첨부</label> |
|
| 1609 |
+ |
|
| 1610 |
+ <div class="img_file_add_wrap basic_img_add_wrap"> |
|
| 1611 |
+ <p class="info_title_text"><span class="c_e40000">*</span> 이미지 첨부 안내</p> |
|
| 1612 |
+ <ul class="info_text"> |
|
| 1613 |
+ <li>- 권장사이즈 : 800px * 400px</li> |
|
| 1585 | 1614 |
<li>- 제한사이즈 : 가로 500px 미만, 가로:세로 비율이 2:1 미만 또는 3:4 초과시 업로드 불가</li> |
| 1586 |
- <li>- 파일형식 : jpg, png (최대 500kb)</li> |
|
| 1587 |
- <li>- 이미지 첨부시 메시지 내용은 최대 400자까지 입력할 수 있습니다.</li> |
|
| 1588 |
- </ul> |
|
| 1589 |
- </div> |
|
| 1590 |
- <div class="img_add_info_wrap wide_img_add_wrap"> |
|
| 1591 |
- <p class="info_title_text"><span class="c_e40000">*</span> 와이드 이미지 첨부 안내</p> |
|
| 1592 |
- <ul class="info_text"> |
|
| 1593 |
- <li>- 권장사이즈 : 800px * 600px</li> |
|
| 1594 |
- <!-- <li>- 제한사이즈 : 가로 500px 미만, 가로:세로 비율이 2:1 미만 또는 3:4 초과시 업로드 불가</li> --> |
|
| 1595 |
- <li>- 파일형식 : jpg, png (최대 2mb)</li> |
|
| 1596 |
- <li>- 와이드 이미지 첨부시 메시지 내용은 최대 76자, 버튼 1개까지 입력할 수 있습니다.</li> |
|
| 1597 |
- </ul> |
|
| 1598 |
- </div> |
|
| 1599 |
- </div> |
|
| 1600 |
- <div class="img_file_add_wrap"> |
|
| 1601 |
- <ul class="img_file_info_wrap"> |
|
| 1602 |
- <li> |
|
| 1603 |
- <p>이미지 제목</p> |
|
| 1604 |
- <input type="text" id="imgTitle" name="imgTitle" value="<c:out value='${resultTemplateVO.imgTitle}'/>" class="img_url" maxLength="50">
|
|
| 1605 |
- </li> |
|
| 1606 |
- <li> |
|
| 1607 |
- <p>이미지 클릭시 이동할 URL</p> |
|
| 1608 |
- <input type="text" id="imgLink" name="imgLink" value="<c:out value='${resultTemplateVO.imgLink}'/>" placeholder="http://" class="img_url" maxLength="1000">
|
|
| 1609 |
- </li> |
|
| 1610 |
- <li> |
|
| 1611 |
- <p class="file_name" id="imgNm" name="imgNm">첨부파일 이미지</p> |
|
| 1612 |
- <button type="button" class="btn_del btnImgDel" onclick="buttonTypeDel(this);"> |
|
| 1613 |
- <img src="/publish/images/btn_delete.png" id="imgDel" alt="이미지 삭제" onclick="fnImageDel();"> |
|
| 1614 |
- </button> |
|
| 1615 |
- </li> |
|
| 1615 |
+ <li>- 파일형식 : jpg, png (최대 5MB)</li> |
|
| 1616 |
+ <li>- 이미지 첨부 시 메시지 내용은 최대 400자, 버튼 5개까지 입력할 수 있습니다.</li> |
|
| 1616 | 1617 |
</ul> |
| 1617 |
- <button type="button" class="btnType btnType8 btn_img_upload" title="이미지 불러오기" onclick="javascript:upImgClick(); return false;">이미지 불러오기</button> |
|
| 1618 |
- <input type="file" id="imgFile" accept=".jpg, .jpeg, .png" onchange="imgResizeInfo(event); return false;" style="display:none"/> |
|
| 1618 |
+<!-- <ul class="img_file_info_wrap"> --> |
|
| 1619 |
+<!-- <li> --> |
|
| 1620 |
+<!-- <button type="button" class="btnType btnType8 btn_img_upload">이미지 불러오기</button> --> |
|
| 1621 |
+<!-- <div class="img_file_wrap"> --> |
|
| 1622 |
+<!-- <p class="file_name">image_testtest.jpg</p> --> |
|
| 1623 |
+<!-- <button type="button" class="btn_del" onclick="buttonTypeDel(this);"> --> |
|
| 1624 |
+<!-- <img src="/publish/images/btn_delete.png" alt=""> --> |
|
| 1625 |
+<!-- </button> --> |
|
| 1626 |
+<!-- </div> --> |
|
| 1627 |
+<!-- </li> --> |
|
| 1628 |
+<!-- <li> --> |
|
| 1629 |
+<!-- <p>이미지 클릭시 이동할 URL</p> <input type="text" --> |
|
| 1630 |
+<!-- placeholder="(선택사항) https://" class="img_url"> --> |
|
| 1631 |
+<!-- </li> --> |
|
| 1632 |
+<!-- </ul> --> |
|
| 1619 | 1633 |
</div> |
| 1634 |
+ <div class="img_file_add_wrap wide_img_add_wrap"> |
|
| 1635 |
+ <p class="info_title_text"><span class="c_e40000">*</span> 와이드 이미지 첨부 안내</p> |
|
| 1636 |
+ <ul class="info_text"> |
|
| 1637 |
+ <li>- 권장사이즈 : 800px * 600px</li> |
|
| 1638 |
+ <li>- 파일형식 : jpg, png (최대 5MB)</li> |
|
| 1639 |
+ <li>- 와이드 이미지 첨부시 메시지 내용은 최대 76자, 버튼 1개까지 입력할 수 있습니다.</li> |
|
| 1640 |
+ </ul> |
|
| 1641 |
+ |
|
| 1642 |
+ |
|
| 1643 |
+ </div> |
|
| 1644 |
+ <ul class="img_file_info_wrap"> |
|
| 1645 |
+ <li> |
|
| 1646 |
+ <button type="button" class="btnType btnType8 btn_img_upload" onclick="javascript:upImgClick(); return false;">이미지 불러오기</button> |
|
| 1647 |
+ <input type="file" id="imgFile" accept=".jpg, .jpeg, .png" onchange="imgResizeInfo(event); return false;" style="display:none"/> |
|
| 1648 |
+ <div class="img_file_wrap"> |
|
| 1649 |
+ <p class="file_name file_none">이미지 없음</p> |
|
| 1650 |
+ <button type="button" class="btn_del" onclick="buttonTypeDel(this);"> |
|
| 1651 |
+ <img src="/publish/images/btn_delete.png" alt=""> |
|
| 1652 |
+ </button> |
|
| 1653 |
+ </div> |
|
| 1654 |
+ </li> |
|
| 1655 |
+ <li> |
|
| 1656 |
+ <p>이미지 클릭시 이동할 URL</p> <input type="text" placeholder="(선택사항) https://" class="img_url"> |
|
| 1657 |
+ </li> |
|
| 1658 |
+ </ul> |
|
| 1659 |
+ |
|
| 1660 |
+ |
|
| 1661 |
+ <%-- <ul class="img_file_info_wrap"> |
|
| 1662 |
+ <li> |
|
| 1663 |
+ <p>이미지 제목</p> |
|
| 1664 |
+ <input type="text" id="imgTitle" name="imgTitle" value="<c:out value='${resultTemplateVO.imgTitle}'/>" class="img_url" maxLength="50">
|
|
| 1665 |
+ </li> |
|
| 1666 |
+ <li> |
|
| 1667 |
+ <p>이미지 클릭시 이동할 URL</p> |
|
| 1668 |
+ <input type="text" id="imgLink" name="imgLink" value="<c:out value='${resultTemplateVO.imgLink}'/>" placeholder="http://" class="img_url" maxLength="1000">
|
|
| 1669 |
+ </li> |
|
| 1670 |
+ <li> |
|
| 1671 |
+ <p class="file_name" id="imgNm" name="imgNm">첨부파일 이미지</p> |
|
| 1672 |
+ <button type="button" class="btn_del btnImgDel" onclick="buttonTypeDel(this);"> |
|
| 1673 |
+ <img src="/publish/images/btn_delete.png" id="imgDel" alt="이미지 삭제" onclick="fnImageDel();"> |
|
| 1674 |
+ </button> |
|
| 1675 |
+ </li> |
|
| 1676 |
+ </ul> |
|
| 1677 |
+ <button type="button" class="btnType btnType8 btn_img_upload" title="이미지 불러오기" onclick="javascript:upImgClick(); return false;">이미지 불러오기</button> |
|
| 1678 |
+ <input type="file" id="imgFile" accept=".jpg, .jpeg, .png" onchange="imgResizeInfo(event); return false;" style="display:none"/> --%> |
|
| 1620 | 1679 |
</td> |
| 1621 | 1680 |
</tr> |
| 1622 | 1681 |
<tr> |
--- src/main/webapp/publish/css/content.css
+++ src/main/webapp/publish/css/content.css
... | ... | @@ -1649,18 +1649,18 @@ |
| 1649 | 1649 |
.kakao_wrap .img_add_info_wrap .info_text{font-size: 15px; color: #555;}
|
| 1650 | 1650 |
.kakao_wrap .img_add_info_wrap .info_text li{margin: 3px 0 0 0;}
|
| 1651 | 1651 |
.kakao_wrap .img_file_add_wrap .info_title_text{font-weight: 500;margin:0 0 5px 0;}
|
| 1652 |
-.kakao_wrap .img_file_add_wrap .btn_img_upload{width: 251px;}
|
|
| 1653 |
-.kakao_wrap .img_file_add_wrap .img_file_info_wrap{width: 100%; max-width: 623px; border: 1px solid #e5e5e5; border-radius: 5px;}
|
|
| 1654 |
-.kakao_wrap .img_file_add_wrap .img_file_info_wrap li{display: flex;min-height: 60px;padding: 10px 20px; border-bottom: 1px solid #e5e5e5;justify-content: space-between; align-items: center; box-sizing: border-box;}
|
|
| 1655 |
-.kakao_wrap .img_file_add_wrap .img_file_info_wrap li:last-child{border-bottom: 0;}
|
|
| 1656 |
-.kakao_wrap .img_file_add_wrap .file_name{font-size: 16px; font-weight: 500;}
|
|
| 1657 |
-.kakao_wrap .img_file_add_wrap .btn_del{width: 30px;height: 30px;border: 1px solid #002c9a;border-radius: 5px;}
|
|
| 1658 |
-.kakao_wrap .img_file_add_wrap .img_url{width: calc(100% - 190px);}
|
|
| 1659 |
-.kakao_wrap .img_file_add_wrap .info_text{margin:0 0 10px 0;}
|
|
| 1660 |
-.kakao_wrap .img_file_add_wrap .info_text li{list-style:1.4;}
|
|
| 1661 |
-.kakao_wrap .img_file_add_wrap .img_file_wrap{display:inline-flex;width:calc(100% - 200px);}
|
|
| 1662 |
-.kakao_wrap .img_file_add_wrap .img_file_wrap .file_name{width:calc(100% - 28px);}
|
|
| 1663 |
-.kakao_wrap .img_file_add_wrap .img_file_wrap .file_name.file_none{color:#666;font-weight:300;line-height:1.8;}
|
|
| 1652 |
+.kakao_wrap .img_file_info_wrap .btn_img_upload{width: 251px;}
|
|
| 1653 |
+.kakao_wrap .img_file_info_wrap{display:none;width: 100%; max-width: 623px; border: 1px solid #e5e5e5; border-radius: 5px;margin:15px 0 0 0;}
|
|
| 1654 |
+.kakao_wrap .img_file_info_wrap li{display: flex;min-height: 60px;padding: 10px 20px; border-bottom: 1px solid #e5e5e5;justify-content: space-between; align-items: center; box-sizing: border-box;}
|
|
| 1655 |
+.kakao_wrap .img_file_info_wrap li:last-child{border-bottom: 0;}
|
|
| 1656 |
+.kakao_wrap .img_file_info_wrap .file_name{font-size: 16px; font-weight: 500;}
|
|
| 1657 |
+.kakao_wrap .img_file_info_wrap .btn_del{width: 30px;height: 30px;border: 1px solid #002c9a;border-radius: 5px;}
|
|
| 1658 |
+.kakao_wrap .img_file_info_wrap .img_url{width: calc(100% - 190px);}
|
|
| 1659 |
+.kakao_wrap .img_file_info_wrap .info_text{margin:0 0 10px 0;}
|
|
| 1660 |
+.kakao_wrap .img_file_info_wrap .info_text li{list-style:1.4;}
|
|
| 1661 |
+.kakao_wrap .img_file_info_wrap .img_file_wrap{display:inline-flex;width:calc(100% - 200px);}
|
|
| 1662 |
+.kakao_wrap .img_file_info_wrap .img_file_wrap .file_name{width:calc(100% - 28px);}
|
|
| 1663 |
+.kakao_wrap .img_file_info_wrap .img_file_wrap .file_name.file_none{color:#666;font-weight:300;line-height:1.8;}
|
|
| 1664 | 1664 |
|
| 1665 | 1665 |
.kakaotalkset_cont .kakao_wrap .template_category{width: 270px;}
|
| 1666 | 1666 |
.kakaotalkset_cont .kakao_wrap .emphasis_select{width: 250px;}
|
--- src/main/webapp/publish/js/content.js
+++ src/main/webapp/publish/js/content.js
... | ... | @@ -522,15 +522,15 @@ |
| 522 | 522 |
$("input[name='img_file_add']").change(function () {
|
| 523 | 523 |
if ($("input[name='img_file_add']:checked").attr("id") == "img_file_1") {
|
| 524 | 524 |
$(".basic_img_add_wrap").show().siblings(".wide_img_add_wrap").hide();
|
| 525 |
- //$(".img_file_add_wrap").show();
|
|
| 525 |
+ $(".img_file_info_wrap").show();
|
|
| 526 | 526 |
$(".kakao_image img").show().attr("src", "/publish/images/content/kakao_img_basic.jpg");
|
| 527 | 527 |
} else if ($("input[name='img_file_add']:checked").attr("id") == "img_file_2") {
|
| 528 | 528 |
$(".wide_img_add_wrap").show().siblings(".basic_img_add_wrap").hide();
|
| 529 | 529 |
$(".kakao_image img").show().attr("src", "/publish/images/content/kakao_img_wide.jpg");
|
| 530 |
- //$(".img_file_add_wrap").show();
|
|
| 530 |
+ $(".img_file_info_wrap").show();
|
|
| 531 | 531 |
} else {
|
| 532 | 532 |
$(".img_add_info_wrap, .img_file_add_wrap").hide();
|
| 533 |
- $(".kakao_image img").hide();
|
|
| 533 |
+ $(".kakao_image img, .img_file_info_wrap").hide();
|
|
| 534 | 534 |
} |
| 535 | 535 |
}); |
| 536 | 536 |
|
--- src/main/webapp/publish/kakao_friendtalk_send.html
+++ src/main/webapp/publish/kakao_friendtalk_send.html
... | ... | @@ -101,6 +101,7 @@ |
| 101 | 101 |
<label for="img_file_1">이미지 첨부</label> |
| 102 | 102 |
<input type="radio" name="img_file_add" id="img_file_2"> |
| 103 | 103 |
<label for="img_file_2">와이드 이미지 첨부</label> |
| 104 |
+ |
|
| 104 | 105 |
<div class="img_file_add_wrap basic_img_add_wrap"> |
| 105 | 106 |
<p class="info_title_text"><span class="c_e40000">*</span> 이미지 첨부 안내</p> |
| 106 | 107 |
<ul class="info_text"> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?