Javaã¨Spring Bootã§IPã¢ãã¬ã¹ãPostgreSQLã«INSERTããéã®è½ã¨ãç©´ã¨å¯¾çã§ããError querying database. Cause: org.postgresql.util.PSQLException: ERROR: column "ip_address" is of type inet but expression is of type character varyingãçºçãâ¦
ã¨ããµã¤ãæ ªå¼ä¼ç¤¾ã¡ãã£ã¢äºæ¥é¨æå±ã®ã¨ã³ã¸ãã¢ã®å²©è¤ã§ãã AWSã§æ°ãããµã¼ãã¹ãä½ãæã«ãå¿ ãVPCã®ä½æã¨ãµããããã®ä½æãè¡ãã¨æãã¾ãã CIDRã®æ¸ãæ¹ã¨ãå®éã«VPCã¨ãµããããã«ã©ãIPãå²ãå½ã¦ããããããä»æ´ãªããã«ç解ã§ãã¦ãªãã£ãâ¦
ããã«ã¡ã¯ãã¨ããµã¤ãæ ªå¼ä¼ç¤¾ã¡ãã£ã¢äºæ¥é¨æå±ã®ã¨ã³ã¸ãã¢å²©è¤ã§ãã ç§ã¯ç¾å¨ãJavaã§GoogleAnalytics4(以ä¸GA4)ã¸ç§»è¡ããããªã£ã¦ãã¾ãã ä»åã¯ãJavaã®GA4ç¨ã¯ã©ã¤ã¢ã³ããAWSã®ECSã¿ã¹ã¯ä¸ã§å®è¡ããéã«ã¯ã©ãã·ã¥ãã件ã¨ãã®å¯¾å¿æ¹æ³ã«ã¤ãâ¦
Javaã¯ã©ã¤ã¢ã³ãã使ã£ã¦ã®GA4ã©ã³ãã³ã°åå¾ã§ã èªè¨¼ç¨ã®JSON(Credentials JSON)ãç°å¢å¤æ°ã§ã¯ãªããæååã§æ¸¡ãæ¹æ³ãç´¹ä»ãã¾ãã
ããã«ã¡ã¯ãã¨ããµã¤ãæ ªå¼ä¼ç¤¾ã¡ãã£ã¢äºæ¥é¨æå±ã®ã¨ã³ã¸ãã¢ã®å²©è¤ã§ãã Universal Analyticsãå©ç¨ã§ããã®ãå¾å°ãã§ããã GoogleAnalytics4(以ä¸GA4)ã¸ç§»è¡ä¸æ¹ãå¤ãã®ã§ã¯ãªãã§ããããã ç§ãã©ã³ãã³ã°ããã°ã©ã ã®ç§»è¡çã£æä¸ã§ãã ä»åGA4â¦
ã¨ããµã¤ãã®ã¨ã³ã¸ãã¢å²©è¤ã§ãã PHPã¨Javaã§md5ã®å¤ãåãã«ããæ¹æ³ãç´¹ä»ãã¾ãã sample.php
ããã«ã¡ã¯ãã¨ã³ã¸ãã¢ã®å²©è¤ã§ãã ä»åã¯Visual Studio Codeã§ã®SSHæ¥ç¶ãåå ã§ãæ¥ç¶å EC2ãµã¼ãã¼ãé«è² è·ã«ãªã£ã¦ãã¾ã£ãç¾è±¡ã¨å¯¾çã«ã¤ãã¦ã話ããã¾ãã ããEC2ãµã¼ãã¼ã§æ°äººã§éçºãã¦ããã¨ããµã¼ãã¼ãæ¥ã«éããªãsshæ¥ç¶ããã§ããªããªãâ¦
ã¨ããµã¤ãã®ã¨ã³ã¸ãã¢å²©è¤ã§ãã ä»å¹´ã¨ããµã¤ãã¯è±ãªã³ãã¬ãµã¼ãã¼ã¨ããäºã§ãawsã«ã»ã¼å ¨ãµã¼ãã¹ã移è¡ãã¾ããã ç§ãæ å½ã®å¸³ç¥¨ãµã¼ãã¹ãå ããµã¼ãã¹ã移è¡ãã¦ãã¾ãã ãã®éãã®ã¾ã¾ã·ã¹ã¹ãã ã移è¡ããã®ã§ã¯ãªããä¸é¨ãããªãé¨åã®ä½ãâ¦
ã¨ããµã¤ãã®ã¨ã³ã¸ãã¢è¤æ²¼ã§ãã Javaã®SpringBootã«ã¦ãGetãã©ã¡ã¼ã¿ã¼ã§æ¥ä»ãLocalDateTimeã§åãåãæ¹æ³ã®è¦æ¸ã§ãã ããããäº ä¸è¨ã®ãããªAPIã«ã¦ãæ¥ä»ãã©ã¡ã¼ã¿ãLocalDateTimeã§åãåããã /api/sample/?start_date_to=20201010000000 ä½â¦
Javaã§ãªãã¸ã§ã¯ãã®ListãããMapãSetãã©ã ãå¼ã§ããã£ã¨ä½ãæ¹æ³è¦æ¸ã§ããã©ã ãå¼ã使ãã°ãforEach使ããã«ç°¡åã«ä½ãã¾ãã