{"id":11265,"date":"2025-07-05T12:01:25","date_gmt":"2025-07-05T03:01:25","guid":{"rendered":"https:\/\/www.moonmile.net\/blog\/?p=11265"},"modified":"2025-07-05T12:01:25","modified_gmt":"2025-07-05T03:01:25","slug":"copilot-claude-sonnet-%e3%82%92%e6%b4%bb%e7%94%a8%e3%81%97%e3%81%a6-web-api-%e3%82%92%e4%bd%9c%e3%82%8b%e4%b8%8b%e6%ba%96%e5%82%99","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/11265","title":{"rendered":"Copilot + Claude Sonnet \u3092\u6d3b\u7528\u3057\u3066 web api \u3092\u4f5c\u308b\u4e0b\u6e96\u5099"},"content":{"rendered":"\n<p>\u3053\u3053\u307e\u3067\u30013\u3064\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08React, Blazor, Kotlin\uff09\u3092\u4f5c\u3063\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f Web API \u3082\u540c\u6642\u306b\u4f5c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u65e2\u5b58\u306e\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\u306f\u3001\u65e2\u306b web api \u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mock \u306e\u30c0\u30df\u30fc\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u4f5c\u308b<\/h2>\n\n\n\n<p>\u65b0\u4eba\u7814\u4fee\u3067\u306f\u30e2\u30b9\u30d0\u30fc\u30ac\u30fc\u306e\u753b\u50cf\u3092\u305d\u306e\u307e\u307e\u501f\u7528\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u7248\u6a29\u7684\u306b\u826f\u304f\u306a\u3044\u306e\u3067\u30c0\u30df\u30fc\u753b\u50cf\u3092\u4f5c\u308a\u307e\u3059\u3002\u6ce8\u6587\u30b5\u30a4\u30c8\uff06\u7ba1\u7406\u30b5\u30a4\u30c8\u306e\u7814\u4fee\u65b9\u5f0f\u306f\u6570\u5e74\u9593\u304b\u3089\u3084\u3063\u3066\u3044\u3066\u3001\u3053\u306e\u30c0\u30df\u30fc\u753b\u50cf\u304c\u7d50\u69cb\u9762\u5012\u306a\u306e\u3067\u3059\u304c\u3001\u3044\u307e\u3060\u3068 OpenAI \u306e DALL-E \u3067\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\u306e\u3053\u3068\u306a\u304c\u3089 OpenAI \u306e API KEY \u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u305d\u3053\u306f\u5fc5\u8981\u7d4c\u8cbb\u3068\u3044\u3046\u3053\u3068\u3067\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u6ce8\u6587\u30b5\u30a4\u30c8\u7528\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<br><br>## \u30ab\u30c6\u30b4\u30ea\u7528\u306e\u753b\u50cf\u4f5c\u6210<br><br><br>```<br>slug      title                                  filename<br>--------  -------------------------------------  --------------------<br>\"special1\"\t\"\u4eca\u6708\u306e\u304a\u85a6\u3081\"                        \"special1.jpg\"<br>\"special3\"\t\"\u9650\u5b9a\u30e1\u30cb\u30e5\u30fc\"                        \"special3.jpg\"  <br>\"special2\"\t\"\u30cd\u30c3\u30c8\u6ce8\u6587\u7279\u5225\u4fa1\u683c\u30e1\u30cb\u30e5\u30fc\"           \"special2.jpg\"<br>\"main1\"\t\"\u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc\"                          \"main1.jpg\"<br>\"main2\"\t\"\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\"                            \"main2.jpg\" <br>\"main3\"\t\"\u30db\u30c3\u30c8\u30c9\u30c3\u30af\"                            \"main3.jpg\"<br>\"main4\"\t\"\u30bd\u30a4\u30d1\u30c6\u30a3\"                              \"main4.jpg\"<br>\"sidemenu1\"\t\"\u30b5\u30a4\u30c9\u30e1\u30cb\u30e5\u30fc\"                      \"sidemenu1.jpg\"<br>\"sidemenu2\"\t\"\u30c9\u30ea\u30f3\u30af\u30fb\u30b9\u30fc\u30d7\"                    \"sidemenu2.jpg\"<br>\"sidemenu3\"\t\"\u30c7\u30b6\u30fc\u30c8\"                           \"sidemenu3.jpg\"<br>```<br><br>\u30ab\u30c6\u30b4\u30ea\u306e title \u306b\u9069\u3057\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092 690x560 px \u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/pre>\n\n\n\n<p>\u3053\u3093\u306a\u5f62\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u66f8\u3044\u3066\u3001Copilot \u306b\u6e21\u3057\u307e\u3059\u304c\u3001\u3042\u3048\u306a\u304f\u632b\u6298\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"679\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47-1024x679.png\" alt=\"\" class=\"wp-image-11266\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47-1024x679.png 1024w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47-300x199.png 300w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47-768x510.png 768w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-47.png 1138w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Claude Sonnet \u3060\u3068\u753b\u50cf\u304c\u3067\u304d\u306a\u3044\u305d\u3046\u306a\u306e\u3067\u3002\u3053\u308c\u3092 ChatGPT \u3067\u3061\u307e\u3061\u307e\u4f5c\u3063\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u30ab\u30c6\u30b4\u30ea\u308210\u7a2e\u985e\u3001\u5546\u54c1\u3068\u306a\u308b\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u7b49\u306e\u753b\u50cf\u306f100\u500b\u3050\u3089\u3044\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001\u91cf\u7523\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3092\u66f8\u3044\u3066\u8cb0\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">openai \u3092\u4f7f\u3063\u3066\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u6307\u793a\u3057\u3066\u3001\u6307\u5b9a\u30b5\u30a4\u30ba\u306e\u753b\u50cf\u3092\u4f5c\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3002<\/pre>\n\n\n\n<p>\u30c4\u30fc\u30eb\u3067\u4f7f\u3046\u8a00\u8a9e\u306f\u4f55\u3067\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001C# \u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>using OpenAI;\nusing OpenAI.Images;\nusing System.ClientModel;\n\nclass Program\n{\n    \/\/ \u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u5b9a\u7fa9\n    private static readonly Dictionary&lt;string, string&gt; CategoryInfo = new()\n    {\n        { &quot;special1&quot;, &quot;\u4eca\u6708\u306e\u304a\u85a6\u3081&quot; },\n        { &quot;special3&quot;, &quot;\u9650\u5b9a\u30e1\u30cb\u30e5\u30fc&quot; },\n        { &quot;special2&quot;, &quot;\u30cd\u30c3\u30c8\u6ce8\u6587\u7279\u5225\u4fa1\u683c\u30e1\u30cb\u30e5\u30fc&quot; },\n        { &quot;main1&quot;, &quot;\u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc&quot; },\n        { &quot;main2&quot;, &quot;\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc&quot; },\n        { &quot;main3&quot;, &quot;\u30db\u30c3\u30c8\u30c9\u30c3\u30af&quot; },\n        { &quot;main4&quot;, &quot;\u30bd\u30a4\u30d1\u30c6\u30a3&quot; },\n        { &quot;sidemenu1&quot;, &quot;\u30b5\u30a4\u30c9\u30e1\u30cb\u30e5\u30fc&quot; },\n        { &quot;sidemenu2&quot;, &quot;\u30c9\u30ea\u30f3\u30af\u30fb\u30b9\u30fc\u30d7&quot; },\n        { &quot;sidemenu3&quot;, &quot;\u30c7\u30b6\u30fc\u30c8&quot; }\n    };\n\n    \/\/ \u5404\u30ab\u30c6\u30b4\u30ea\u306b\u5bfe\u5fdc\u3059\u308b\u82f1\u8a9e\u30d7\u30ed\u30f3\u30d7\u30c8\n    private static readonly Dictionary&lt;string, string&gt; CategoryPrompts = new()\n    {\n        { &quot;special1&quot;, &quot;A beautiful and appetizing seasonal hamburger set with fresh ingredients, warm orange and yellow color scheme, professional food photography, featuring &#39;Monthly Recommendation&#39; text overlay&quot; },\n        { &quot;special3&quot;, &quot;A premium limited edition hamburger with luxury presentation, elegant black and gold color scheme, high-end food photography, featuring &#39;Limited Menu&#39; text overlay&quot; },\n        { &quot;special2&quot;, &quot;A special price hamburger with discount elements, eye-catching red and white color scheme, online ordering theme, featuring &#39;Special Online Price&#39; text overlay&quot; },\n        { &quot;main1&quot;, &quot;A variety of delicious hamburgers arranged together, appetizing brown and red color scheme, main menu showcase, featuring &#39;Main Menu&#39; text overlay&quot; },\n        { &quot;main2&quot;, &quot;A classic hamburger cross-section showing layers of bun, patty, and fresh vegetables, vibrant green, red, and brown colors, featuring &#39;Hamburger&#39; text overlay&quot; },\n        { &quot;main3&quot;, &quot;A delicious hot dog with sausage, bun, mustard and ketchup, warm brown and red color scheme, featuring &#39;Hot Dog&#39; text overlay&quot; },\n        { &quot;main4&quot;, &quot;A healthy soy patty burger with fresh vegetables, healthy green and brown color scheme, emphasizing healthiness, featuring &#39;Soy Patty&#39; text overlay&quot; },\n        { &quot;sidemenu1&quot;, &quot;A variety of side dishes including french fries and onion rings, golden yellow color scheme, featuring &#39;Side Menu&#39; text overlay&quot; },\n        { &quot;sidemenu2&quot;, &quot;Various drinks and soups with glasses, cups, ice, and steam, refreshing blue and clear color scheme, featuring &#39;Drinks & Soup&#39; text overlay&quot; },\n        { &quot;sidemenu3&quot;, &quot;Delicious desserts including ice cream and pies, sweet pastel color scheme, happy atmosphere, featuring &#39;Dessert&#39; text overlay&quot; }\n    };\n\n    static async Task Main(string[] args)\n    {\n        \/\/ OpenAI API \u30ad\u30fc\u3092\u74b0\u5883\u5909\u6570\u304b\u3089\u53d6\u5f97\n        var apiKey = Environment.GetEnvironmentVariable(&quot;OPENAI_API_KEY&quot;);\n        if (string.IsNullOrEmpty(apiKey))\n        {\n            Console.WriteLine(&quot;\u30a8\u30e9\u30fc: OPENAI_API_KEY \u74b0\u5883\u5909\u6570\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002&quot;);\n            Console.WriteLine(&quot;\u4f7f\u7528\u65b9\u6cd5: set OPENAI_API_KEY=your_api_key_here&quot;);\n            return;\n        }\n\n        var client = new OpenAIClient(apiKey);\n\n        \/\/ \u51fa\u529b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\n        var outputDir = Path.Combine(Directory.GetCurrentDirectory(), &quot;generated_images&quot;);\n        Directory.CreateDirectory(outputDir);\n\n        Console.WriteLine(&quot;\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u6ce8\u6587\u30b5\u30a4\u30c8\u7528\u753b\u50cf\u751f\u6210\u30c4\u30fc\u30eb&quot;);\n        Console.WriteLine(&quot;========================================&quot;);\n\n        if (args.Length == 0)\n        {\n            Console.WriteLine(&quot;\u4f7f\u7528\u65b9\u6cd5:&quot;);\n            Console.WriteLine(&quot;  \u3059\u3079\u3066\u306e\u30ab\u30c6\u30b4\u30ea\u753b\u50cf\u3092\u751f\u6210: dotnet run all&quot;);\n            Console.WriteLine(&quot;  \u7279\u5b9a\u306e\u30ab\u30c6\u30b4\u30ea\u753b\u50cf\u3092\u751f\u6210: dotnet run &lt;slug&gt;&quot;);\n            Console.WriteLine(&quot;  \u30ab\u30b9\u30bf\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u751f\u6210: dotnet run custom \\&quot;&lt;prompt&gt;\\&quot; &lt;filename&gt;&quot;);\n            Console.WriteLine();\n            Console.WriteLine(&quot;\u5229\u7528\u53ef\u80fd\u306a\u30ab\u30c6\u30b4\u30ea:&quot;);\n            foreach (var category in CategoryInfo)\n            {\n                Console.WriteLine($&quot;  {category.Key} - {category.Value}&quot;);\n            }\n            return;\n        }\n<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u624b\u306e\u3084\u3064\u306f\u3001\u3061\u307e\u3061\u307e\u672c\u306b\u66f8\u3044\u305f\u899a\u3048\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001AI \u306b\u66f8\u3044\u3066\u8cb0\u3046\u307b\u3046\u304c\u65ad\u7136\u697d\u3067\u3059\u3002\u3069\u3046\u305b\u4f7f\u3044\u6368\u3066\u30c4\u30fc\u30eb\u306a\u306e\u3067\u3001\u4e2d\u8eab\u306f\u3069\u3046\u3068\u3044\u3046\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u753b\u50cf\u3092\u4f5c\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"445\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-1024x445.png\" alt=\"\" class=\"wp-image-11267\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-1024x445.png 1024w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-300x130.png 300w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-768x334.png 768w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-1536x668.png 1536w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-48-2048x890.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u5546\u54c1\u753b\u50cf\u306e\u307b\u3046\u306f\u91cf\u304c\u591a\u3044\u306e\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u3082\u4f7f\u3044\u6368\u3066\u30c4\u30fc\u30eb\u306a\u306e\u3067\u5546\u54c1\u753b\u50cf\u306e\u4f5c\u6210\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u540c\u3058\u30d1\u30bf\u30fc\u30f3\u3067\u3001\u5546\u54c1\u753b\u50cf\u306e\u4f5c\u6210\u3082\u8ffd\u52a0\u3057\u3066\u3002<\/pre>\n\n\n\n<p>\u4e92\u63db\u6027\u3082\u306a\u3093\u306e\u305d\u306e\u3001\u8c6a\u5feb\u306b\u30e1\u30cb\u30e5\u30fc\u3092\u66f8\u304d\u5909\u3048\u3066\u300c\u30ab\u30c6\u30b4\u30ea\u753b\u50cf\u300d\u3068\u300c\u5546\u54c1\u753b\u50cf\u300d\u306e\u4e21\u65b9\u304c\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>        Console.WriteLine(&quot;\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u6ce8\u6587\u30b5\u30a4\u30c8\u7528\u753b\u50cf\u751f\u6210\u30c4\u30fc\u30eb&quot;);\n        Console.WriteLine(&quot;========================================&quot;);\n\n        if (args.Length == 0)\n        {\n            Console.WriteLine(&quot;\u4f7f\u7528\u65b9\u6cd5:&quot;);\n            Console.WriteLine(&quot;  \u3059\u3079\u3066\u306e\u30ab\u30c6\u30b4\u30ea\u753b\u50cf\u3092\u751f\u6210: dotnet run category-all&quot;);\n            Console.WriteLine(&quot;  \u7279\u5b9a\u306e\u30ab\u30c6\u30b4\u30ea\u753b\u50cf\u3092\u751f\u6210: dotnet run category &lt;slug&gt;&quot;);\n            Console.WriteLine(&quot;  \u3059\u3079\u3066\u306e\u5546\u54c1\u753b\u50cf\u3092\u751f\u6210: dotnet run product-all&quot;);\n            Console.WriteLine(&quot;  \u7279\u5b9a\u306e\u5546\u54c1\u753b\u50cf\u3092\u751f\u6210: dotnet run product &lt;slug&gt;&quot;);\n            Console.WriteLine(&quot;  \u30ab\u30b9\u30bf\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u751f\u6210: dotnet run custom \\&quot;&lt;prompt&gt;\\&quot; &lt;filename&gt;&quot;);\n            Console.WriteLine();\n            Console.WriteLine(&quot;\u5229\u7528\u53ef\u80fd\u306a\u30ab\u30c6\u30b4\u30ea:&quot;);\n            foreach (var category in CategoryInfo)\n            {\n                Console.WriteLine($&quot;  {category.Key} - {category.Value}&quot;);\n            }\n            Console.WriteLine();\n            Console.WriteLine(&quot;\u5229\u7528\u53ef\u80fd\u306a\u5546\u54c1:&quot;);\n            foreach (var product in ProductInfo)\n            {\n                Console.WriteLine($&quot;  {product.Key} - {product.Value}&quot;);\n            }\n            return;\n        }\n<\/code><\/pre><\/div>\n\n\n\n<p>\u751f\u6210\u4e2d\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49-1024x541.png\" alt=\"\" class=\"wp-image-11268\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49-1024x541.png 1024w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49-300x159.png 300w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49-768x406.png 768w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49-1536x812.png 1536w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-49.png 1805w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u3072\u3068\u307e\u305a\u3001\u3053\u308c\u3067\u7248\u6a29\u3092\u30af\u30ea\u30a2\u3057\u305f\u753b\u50cf\u306e\u4f5c\u6210\u304c\u5b8c\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9<\/h2>\n\n\n\n<p>DDL\u5b9a\u7fa9\uff08\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\uff09\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f1a\u793e\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8a2d\u8a08\u66f8\u306a\u3069\u3092\u4f5c\u308b\u3068\u304d\u306f Excel \u3092\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u304a\u305d\u3089\u304f ddl.md \u3068\u3044\u3046\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3001create table \u306e\u5b9a\u7fa9\u3092\u4e26\u3079\u3066\u304a\u3044\u305f\u307b\u3046\u304c AI \u306b\u7406\u89e3\u3057\u3084\u3059\u3044\u3067\u3059\u3002\u3044\u3063\u305f\u3093\u3001MySQL Workbeanch \u3068\u304b\u3001SQL Server Management Studio \u306a\u3069\u3092\u4f7f\u3063\u3066\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u3057\u305f\u5f8c\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u843d\u3068\u3057\u8fbc\u3093\u3067\u3082\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># DDL \u5b9a\u7fa9<br><br>## categories<br><br>\u30ab\u30c6\u30b4\u30ea\u306e\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3067\u3059\u3002<br><br>```sql<br>CREATE TABLE categories (<br>    id INTEGER PRIMARY KEY AUTOINCREMENT,<br>    slug varchar(255) NOT NULL UNIQUE,<br>    title varchar(255) NOT NULL,<br>    description TEXT,<br>    image varchar(255),<br>    sortid INTEGER NOT NULL DEFAULT 0,<br>    display INTEGER NOT NULL DEFAULT 1,<br>    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    deleted_at TIMESTAMP NULL DEFAULT NULL,<br>);<br>```<br>## products<br><br>\u5546\u54c1\u306e\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3067\u3059\u3002<br><br>```sql<br>CREATE TABLE products (<br>    id INTEGER PRIMARY KEY AUTOINCREMENT,<br>    category_id INTEGER,<br>    slug varchar(255) NOT NULL UNIQUE,<br>    name varchar(255) NOT NULL,<br>    description TEXT,<br>    image varchar(255),<br>    price REAL NOT NULL,<br>    sortid INTEGER NOT NULL DEFAULT 0,<br>    display INTEGER NOT NULL DEFAULT 1,<br>    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    deleted_at TIMESTAMP NULL DEFAULT NULL,<br>    FOREIGN KEY (category_id) REFERENCES categories(id)<br>);<br>```<br><br>## orders<br><br>\u6ce8\u6587\u306e\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3067\u3059\u3002<br><br>```sql<br>CREATE TABLE orders (<br>    id INTEGER PRIMARY KEY AUTOINCREMENT,<br>    order_number varchar(10) NOT NULL,<br>    total_price REAL NOT NULL,<br>    total_quantity INTEGER NOT NULL,<br>    status INTEGER NOT NULL DEFAULT 0,<br>    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    deleted_at TIMESTAMP NULL DEFAULT NULL,<br>);<br>```<br><br>## order_products <br><br>\u6ce8\u6587\u3068\u5546\u54c1\u3092\u95a2\u9023\u4ed8\u3051\u308b\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3067\u3059\u3002<br><br>```sql<br>CREATE TABLE order_products (<br>    id INTEGER PRIMARY KEY AUTOINCREMENT,<br>    order_id INTEGER NOT NULL,<br>    product_id INTEGER NOT NULL,<br>    price REAL NOT NULL,<br>    quantity INTEGER NOT NULL,<br>    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,<br>    deleted_at TIMESTAMP NULL DEFAULT NULL,<br>    FOREIGN KEY (order_id) REFERENCES orders(id),<br>    FOREIGN KEY (product_id) REFERENCES products(id)<br>);<br>```<\/pre>\n\n\n\n<p>\u30b3\u30fc\u30c9\u30d5\u30a1\u30fc\u30b9\u30c8\u5f62\u5f0f\u306e\u5834\u5408\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30b3\u30fc\u30c9\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u66f8\u304f\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u8a00\u8a9e\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u4f9d\u5b58\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002Ruby, Laravel, C# \u306a\u3069\u305d\u308c\u305e\u308c\u306e\u8a00\u8a9e\u3067\u3057\u304b\u4f7f\u3048\u306a\u3044\u5f62\u5f0f\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001CREATE TABLE \u306e\u3088\u3046\u306b SQL \u306e\u307e\u307e\u306e\u307b\u3046\u304c\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u305f\u3076\u3093\u3001\u5404\u8a00\u8a9e\u3067\u66f8\u3044\u305f\u3068\u3057\u3066\u3082\u5225\u306e\u8a00\u8a9e\u306b AI \u304c\u30b3\u30f3\u30d0\u30fc\u30c8\u3057\u3066\u304f\u308c\u308b\u3060\u308d\u3046\u304b\u3089\u3001\u5927\u4e08\u592b\u3060\u3068\u306f\u601d\u3046\u306e\u3067\u3059\u304c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OpenAPI\u5b9a\u7fa9\u3092\u66f8\u304f<\/h2>\n\n\n\n<p>web api \u306e\u5b9a\u7fa9\u3068\u3057\u3066\u3001RESTful \u3067\u66f8\u3044\u3066\u3044\u304f\u304b\u3001OpenAPI \u3067\u66f8\u3044\u3066\u3044\u304f\u304b\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u3069\u3046\u8a18\u8ff0\u3057\u3066\u3044\u304f\u304b\u304c\u554f\u984c\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f OpenAPI\u5b9a\u7fa9\u3092\u76f4\u63a5\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u90e8\u5206\u3082\u8af8\u3005\u4ed5\u69d8\u66f8\u306b\u66f8\u304d\u8d77\u3053\u3059\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u73fe\u72b6\u3060\u3068<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u304b\u3089 OpenAPI \u5b9a\u7fa9\u3092\u66f8\u304d\u51fa\u3059<\/li>\n\n\n\n<li>OpenAPI \u5b9a\u7fa9\u304b\u3089\u8a2d\u8a08\u66f8\u7b49\u3078\u66f8\u304d\u51fa\u3059<\/li>\n<\/ul>\n\n\n\n<p>\u306e\u3088\u3046\u306b\u3001\u30ea\u30d0\u30fc\u30b9\u578b\u5f0f\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u66f8\u3044\u305f\u307b\u3046\u304c\u697d\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">db\/ddl.md \u306e\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u53c2\u8003\u306b\u3057\u3066\u3001<br>mos-api.yaml \u306b CURD \u3092\u547c\u3073\u51fa\u305b\u308b openapi \u3092\u66f8\u304d\u51fa\u3057\u3066\u3002<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b DDL \u306e\u5b9a\u7fa9\u304b\u3089 CRUD \u5f62\u5f0f\u3092\u4e00\u767a\u3067\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">openapi: 3.1.1<br>info:<br>  title: Mos API<br>  description: Mos API<br>  version: 1.0.0<br>  contact:<br>    name: moonmile solutions<br>servers:<br>  - url: \"http:\/\/localhost:8000\/mos\/api\"<br>paths:<br>  # Categories CRUD<br>  \/categories:<br>    get:<br>      summary: Get all categories<br>      operationId: getCategories<br>      parameters:<br>        - name: display<br>          in: query<br>          description: Filter by display status<br>          required: false<br>          schema:<br>            type: integer<br>            enum: [0, 1]<br>      responses:<br>        '200':<br>          description: Successful response<br>          content:<br>            application\/json:<br>              schema:<br>                type: array<br>                items:<br>                  $ref: '#\/components\/schemas\/Category'<br>    post:<br>      summary: Create a new category<br>      operationId: createCategory<br>      requestBody:<br>        required: true<br>        content:<br>          application\/json:<br>            schema:<br>              $ref: '#\/components\/schemas\/CategoryCreate'<br>      responses:<br>        '201':<br>          description: Category created successfully<br>          content:<br>            application\/json:<br>              schema:<br>                $ref: '#\/components\/schemas\/Category'<br>        '400':<br>          description: Bad request<br>          content:<br>            application\/json:<br>              schema:<br>                $ref: '#\/components\/schemas\/Error'<br>...<\/pre>\n\n\n\n<p>\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u6ce8\u6587\u30b5\u30a4\u30c8\u306e\u5834\u5408\u306f\u3001\u6ce8\u6587 \/orders \u306a\u3069\u3001\u3044\u304f\u3064\u304b\u306e web api \u3092\u7528\u610f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3072\u3068\u307e\u305a Copilot \u3067 mos-api.yaml \u3092\u66f8\u3044\u3066\u8cb0\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-scaled.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"488\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-1024x488.png\" alt=\"\" class=\"wp-image-11269\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-1024x488.png 1024w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-300x143.png 300w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-768x366.png 768w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-1536x733.png 1536w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/07\/image-50-2048x977.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>vscode \u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u3082\u3067\u304d\u308b\u3057\u3001\u5b9f\u969b\u306b\u3053\u3053\u304b\u3089 web api \u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u7167<\/h2>\n\n\n\n<p>moonmile\/mos-ai-sample: opilot + Claude Sonnet 4 \u3067\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u6ce8\u6587\u30b5\u30a4\u30c8\u4f5c\u6210\u306e\u30b5\u30f3\u30d7\u30eb <a href=\"https:\/\/github.com\/moonmile\/mos-ai-sample\">https:\/\/github.com\/moonmile\/mos-ai-sample<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>src\/tools\/make-image \u30c0\u30df\u30fc\u753b\u50cf\u306e\u4f5c\u6210\u30c4\u30fc\u30eb<\/li>\n\n\n\n<li>src\/db\/ddl.md \u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9<\/li>\n\n\n\n<li>src\/webapi\/mos-api.yaml OpenAPI \u5b9a\u7fa9<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3053\u307e\u3067\u30013\u3064\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08React, Blazor, Kotlin\uff09\u3092\u4f5c\u3063\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f Web API \u3082\u540c\u6642\u306b\u4f5c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u65e2\u5b58\u306e\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\u306f\u3001\u65e2\u306b web api \u304c\u3042\u308b\u304b\u3082\u3057 &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/11265\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-11265","post","type-post","status-publish","format-standard","hentry","category-dev"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=11265"}],"version-history":[{"count":1,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11265\/revisions"}],"predecessor-version":[{"id":11270,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11265\/revisions\/11270"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=11265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=11265"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=11265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}